Untitled
unknown
c_cpp
2 years ago
547 B
3
Indexable
#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 << "Демон не пришел, все норм)";
}
}
}Editor is loading...
Leave a Comment