@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 << "Нечетно"; } } Code #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-ой переменной сделать The post was merged to previous Mar 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 << "Нечетно"; } } Code #include <iostream> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int number; cout << "Введите число: "; cin >> number; if (number%2 == 0) { cout << "Четное"; } else{ cout << "Нечетно"; } }