#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
int main() {
setlocale(LC_ALL, "ru");
int res, otv;
int i = 0;
res = 0;
do {
i++;
srand(time(0));
int x = rand() % 10 + 1;
int y = rand() % 10 + 1;
int operation = rand() % 4;
switch (operation) {
case 0:
res = x * y;
cout << " Сколько будет " << x << " * " << y << " = ";
break;
case 1:
res = x + y;
cout << " Сколько будет " << x << " + " << y << " = ";
break;
case 2:
res = x - y;
cout << " Сколько будет " << x << " - " << y << " = ";
break;
case 3:
res = pow(x, 2) + pow(y, 2);
cout << " Сколько будет " << x << "^2 + " << y << "^2 = ";
break;
}
cin >> otv;
if (res == otv) {
cout << " Ответ верный" << endl;
}