@advent3453 #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int number, reshenie; cout << "Введите число: "; cin >> number; reshenie = number % 2; if (reshenie == 0) { cout << "Четное"; } else{ cout << "Нечетно"; } } Код #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int number, reshenie; cout << "Введите число: "; cin >> number; reshenie = number % 2; if (reshenie == 0) { cout << "Четное"; } else{ cout << "Нечетно"; } }
Писал спеша , сейчас смотрю можно было и без 2-ой переменной сделать --- Сообщение объединено с предыдущим 5 мар 2021 #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int number; cout << "Введите число: "; cin >> number; if (number%2 == 0) { cout << "Четное"; } else{ cout << "Нечетно"; } } Код #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int number; cout << "Введите число: "; cin >> number; if (number%2 == 0) { cout << "Четное"; } else{ cout << "Нечетно"; } }