Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HomeWorks
- {
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine(); // hello
- int countVowels = 0;
- char[] vowelsChars = { 'a', 'e', 'o', 'y' };
- for (int i = 0; i < text.Length; i++)
- {
- for (int j = 0; j < vowelsChars.Length; j++)
- {
- if (text[i] == vowelsChars[j])
- {
- countVowels++; // + 1
- }
- }
- }
- Console.WriteLine(countVowels);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment