Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace VowelsCount
- {
- class Program
- {
- static void Main()
- {
- PrintVowelsCount();
- }
- public static void PrintVowelsCount()
- {
- string inputString = Console.ReadLine().ToLower();
- int vowelCounts = 0;
- for (int i = 0; i < inputString.Length; i++)
- {
- bool isVowel = (char)inputString[i] == 97 || (char)inputString[i] == 101 || (char)inputString[i] == 105 || (char)inputString[i] == 111 || (char)inputString[i] == 117;
- if(isVowel)
- {
- vowelCounts += 1;
- }
- }
- Console.WriteLine(vowelCounts);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement