Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int BestScore = 0;
  13. string winner = "";
  14. for (; ; )
  15. {
  16. string str = Console.ReadLine();
  17. int score = 0;
  18. int y = str.Length - 1;
  19. int a = 0;
  20. if (str == "END OF GAME") break;
  21. else
  22. {
  23. for (int i = 0; i < str.Length; i++)
  24. {
  25. a = a + (int)str[i];
  26. }
  27. }
  28. if (str[0] >= 'A' && str[0] <= 'Z')
  29. {
  30. a = a + 15;
  31. }
  32. if (str[y] == 't')
  33. {
  34. a = a + 20;
  35. }
  36. if (str.Length >= 10)
  37. {
  38. a = a + 30;
  39. }
  40. score = a;
  41. if (BestScore < score)
  42. {
  43. BestScore = score;
  44. winner = str;
  45. }
  46. }
  47. Console.WriteLine("Winner is word: {0}", winner);
  48. Console.WriteLine("Points: {0}",BestScore);
  49. {
  50.  
  51. }
  52.  
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement