Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
547 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main() {
	setlocale(LC_ALL, "Russian");
	int n, count = 0, count1 = 0, a6 = 0, max = 0;
	cin >> n;
	while (n != 0) {
		count += n % 10;
		if (n % 10 >= max) {
			max = n % 10;
		}
		count1 += 1;
		if (n % 10 == 6) {
			a6 += 1;
		}
		n /= 10;
	}
	if (count % 2 == 0 and count1 < 4){
		cout << max;
	}
	else {
		if (a6 >= 3) {
			cout << "ТЫ ВЫЗВАЛ ДЬЯВОЛА, ГЛУПЕЦ!!!";
		}
		else {
			cout << "Демон не пришел, все норм)";
		}
	}
}
Leave a Comment