Advertisement
spasnikolov131

Untitled

Jul 5th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06._The_Most_Powerful_Word
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. decimal points = 0;
  10.  
  11. while (true)
  12. {
  13. string line = Console.ReadLine();
  14. if (line == "End of words")
  15. {
  16. break;
  17. }
  18. for (int i = 0; i < line.Length; i++)
  19. {
  20. char currentLetter = line[i];
  21. points += currentLetter;
  22.  
  23. if (line[0] == 'a' || line[0] == 'e' || line[0] == 'i' || line[0] == 'o' || line[0] == 'u' || line[0] == 'y'
  24. || line[0] == 'A' || line[0] == 'E' || line[0] == 'I' || line[0] == 'O' || line[0] == 'U' || line[0] == 'Y')
  25. {
  26. points = points * line.Length;
  27.  
  28. }
  29. else
  30. {
  31. points += i;
  32. }
  33. }
  34. points = Math.Floor(points / line.Length);
  35. }
  36.  
  37. Console.WriteLine(points);
  38. }
  39. }
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement