class Program { static void Main() { Console.WriteLine("Введите последовательность символов, заканчивающуюся точкой:"); string input = Console.ReadLine();
int countA = 0; int countB = 0; foreach(char c in input) { if(Char.ToLower(c) == 'а') { countA++; } else if(Char.ToLower(c) == 'б') { countB++; } } if(countA > countB) { Console.WriteLine("Букв А больше, чем букв Б."); } else if(countA < countB) { Console.WriteLine("Букв Б больше, чем букв А."); } else { Console.WriteLine("Количество букв А и Б одинаково."); } }
using System;
class Program
int countA = 0;{
static void Main()
{
Console.WriteLine("Введите последовательность символов, заканчивающуюся точкой:");
string input = Console.ReadLine();
int countB = 0;
foreach(char c in input)
{
if(Char.ToLower(c) == 'а')
{
countA++;
}
else if(Char.ToLower(c) == 'б')
{
countB++;
}
}
if(countA > countB)
{
Console.WriteLine("Букв А больше, чем букв Б.");
}
else if(countA < countB)
{
Console.WriteLine("Букв Б больше, чем букв А.");
}
else
{
Console.WriteLine("Количество букв А и Б одинаково.");
}
}
}