diff --git a/lesson_42/main.cpp b/lesson_42/main.cpp new file mode 100644 index 0000000..2d06416 --- /dev/null +++ b/lesson_42/main.cpp @@ -0,0 +1,30 @@ +/* + * main.cpp + * + * Created on: 13 авг. 2021 г. + * Author: alexander + */ +#include + +using namespace std; + +int main() +{ + // Задание 1 + // 6 + 5 * 4 % 3 = 8, т.к. (6 + ((5 * 4) % 3)) + // 1. (5 * 4) = 20 + // 2. (20 % 3) = 2 + // 3. (6 + 2) = 8 + cout << 6 + 5 * 4 % 3 << endl; + + // Задание 2 + cout << "Введите целое число: "; + int a; + cin >> a; + cout << "Число является" << ((a % 2 == 0) ? " " : " не ") << "четным" << endl; + + return 0; +} + + +