Compare commits
No commits in common. "lesson_42" and "master" have entirely different histories.
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* main.cpp
|
|
||||||
*
|
|
||||||
* Created on: 13 авг. 2021 г.
|
|
||||||
* Author: alexander
|
|
||||||
*/
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue