Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace _02._Vowels_Count
  5. {
  6. class Program
  7. {
  8.  
  9. static void Main(string[] args)
  10. {
  11.  
  12. VowelsCount();
  13. }
  14.  
  15. static void VowelsCount()
  16. {
  17. string command = Console.ReadLine().ToLower();
  18. var letters = new string[] { "a", "e", "i", "o", "u" };
  19. int count = 0;
  20.  
  21. for (int i = 0; i < command.Length; i++)
  22. {
  23. if (command.Contains(letters[i]))
  24. {
  25. count++;
  26.  
  27. }
  28.  
  29. }
  30. Console.WriteLine(count);
  31.  
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement