Untitled

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

int main() {
    setlocale(LC_ALL, "russian");

    int n;
    int res = 0;
    int a = 0;
    int l = 0;
    int l6 = 0;
    int sum = 0;
    int max = 0;

    cin >> n;

    while (n != 0) {
        a = n % 10;
        if (a > max) {
            max = a;
        }
        if (a == 6) {
            l6 += 1;
        }
        n = n / 10;
        l += 1;
        sum += a;
    }
    if (sum % 2 == 0 and l < 4) {
        cout << max;
    }
    else if (l6 == 3) {
        cout << "ЧИСЛО ЗВЕРЯ!!!!!!!";
    }
}
Leave a Comment