Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string inp = Console.ReadLine();
- string[] newinp = inp.Split(" ");
- int summ = 0;
- string lastword = newinp[newinp.Length - 1];
- for (int i= 0;i<=lastword.Length-1;i++)
- {
- if ("A".Contains(lastword[i]) || "a".Contains(lastword[i]) || "А".Contains(lastword[i]) || "а".Contains(lastword[i]))
- {
- summ++;
- }
- }
- Console.WriteLine("Количество букв 'а' в слове {0} равно {1}", newinp[newinp.Length - 1],summ);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement