Untitled

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

int main()
{
	setlocale(LC_ALL, "Russian");
	int n;
	cin >> n;

	int sum = 0;
	int D = 0;
	int Aval = 0;
	int max = -1;

	while (n > 0) {//125
		int digit = n % 10;
		sum += digit;
		D += 1;
		n /= 10;
		if (digit == 6) {
			Aval++;
		}
		if (digit >= max)max = digit;
	}
	if (sum % 2 == 0 && D < 4 && Aval != 3) {
		cout << "Самая большая цифра:" << max ;
	}
	if (Aval >= 3) {
		cout << "У вас число зверя.";
	}
}
Leave a Comment