zh_stoqnov

Illuminati

Oct 26th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Illuminati
  4. {
  5. class Illuminati
  6. {
  7. public static void Main(string[] args)
  8. {
  9. string input = Console.ReadLine();
  10. int countA = 0;
  11. int countE = 0;
  12. int countI = 0;
  13. int countO = 0;
  14. int countU = 0;
  15. int sum = 0;
  16. foreach(var ch in input)
  17. {
  18. switch(ch)
  19. {
  20. case 'a': countA += 1; break;
  21. case 'A': countA += 1; break;
  22. case 'e': countE += 1; break;
  23. case 'E': countE += 1; break;
  24. case 'i': countI += 1; break;
  25. case 'I': countI += 1; break;
  26. case 'o': countO += 1; break;
  27. case 'O': countO += 1; break;
  28. case 'u': countU += 1; break;
  29. case 'U': countU += 1; break;
  30. }
  31.  
  32. }
  33. Console.WriteLine(countA + countE + countI + countO + countU);
  34. sum = countA * 65 + countE * 69 + countI * 73 + countO * 79 + countU * 85;
  35. Console.WriteLine(sum);
  36.  
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment