using System;
class MainClass {public static void Main (string[] args) {Console.WriteLine ("Введите число:");int n = Convert.ToInt32(Console.ReadLine());
}
public static int CountEvenDigits(int number) {int count = 0;
}}
//Пример работы программы://Введите число://123456//Количество чётных цифр в числе 123456 = 3
using System;
class MainClass {
int evenDigitsCount = CountEvenDigits(n);public static void Main (string[] args) {
Console.WriteLine ("Введите число:");
int n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine($"Количество чётных цифр в числе {n} = {evenDigitsCount}");
}
public static int CountEvenDigits(int number) {
while (number > 0) {int count = 0;
int digit = number % 10;
if (digit % 2 == 0) {
count++;
}
number /= 10;
}
return count;
}
}
//Пример работы программы:
//Введите число:
//123456
//Количество чётных цифр в числе 123456 = 3