
Ермоген
4 год назад
Пожалуйста посчитайте пожалуйста!!!! На языке программирования #CВвести три строки, сцепить их.В результирующей строке подсчитать количество заглавных букв. Продублировать все запятые. Результат вывести на экран.
ОТВЕТЫ

Kim
Oct 24, 2020
int count = 0;
string str1 = Console.ReadLine();
string str2 = Console.ReadLine();
string str3 = Console.ReadLine();
string str = str1 + str2 + str3;
Console.WriteLine(str);
for (int i = 0; i < str.Length; i++) {
if (char.IsUpper(str[i])) {
count += 1;
}
}
Console.WriteLine("Всего " + count + " заглавные буквы"); Console.ReadKey();
string str1 = Console.ReadLine();
string str2 = Console.ReadLine();
string str3 = Console.ReadLine();
string str = str1 + str2 + str3;
Console.WriteLine(str);
for (int i = 0; i < str.Length; i++) {
if (char.IsUpper(str[i])) {
count += 1;
}
}
Console.WriteLine("Всего " + count + " заглавные буквы"); Console.ReadKey();
10
Смежные вопросы: