Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string text = Console.ReadLine();
- int countLower = 0;
- int countUpper = 0;
- int countWhiteSpace = 0;
- for (int i = 0; i < text.Length; i++)
- {
- char currentChar = text[i];
- if (Char.IsUpper(currentChar))
- {
- countUpper++;
- }
- else if (Char.IsLower(currentChar))
- {
- countLower++;
- }
- else if (Char.IsWhiteSpace(currentChar))
- {
- countWhiteSpace++;
- }
- }
- Console.WriteLine(countUpper);
- Console.WriteLine(countLower);
- Console.WriteLine(countWhiteSpace);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement