54 прочтения · 11 месяцев назад
Программа C++ предназначена для проверки знаний пользователя таблицы умножения от 0 до 10.
Пошаговое объяснение того, что будет делать код: Вот сам код: #include <iostream> #include <algorithm> using namespace std; int main(){ int res, otv; int i = 0; res = 0; do{ i++; srand(time(0)); int x = rand() % 11; int y = rand() % 11; res = x * y; res = x * y; cout << "Сколько будет " << x << " * " << y << " = "; cin >> otv; if (res == otv){ cout << "Ответ верный" << endl; }else { cout << "Вы ответили не верно." << endl; ...
3 прочтения · 10 месяцев назад
Проверка на знание умножения, разности, сложение и возведение в квадрат
#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 << " = "; ...