Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace VowelsCount
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- char[] vowels = { 'a', 'o', 'u', 'e', 'i', 'A', 'O', 'U', 'E', 'I' };
- Console.WriteLine(CountVowels(input, vowels));
- }
- static int CountVowels(string input, char[] vowels)
- {
- int vowelsCount = 0;
- for (int i = 0; i < input.Length; i++)
- {
- if (vowels.Contains(input[i]))
- {
- vowelsCount++;
- }
- }
- return vowelsCount;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment