Advertisement
nnikolov

Untitled

Mar 28th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace asdasd
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. using System;
  10.  
  11.  
  12. namespace ConsoleApp25
  13. {
  14. class Program
  15. {
  16. static void Main(string[] args)
  17. {
  18.  
  19. int days = int.Parse(Console.ReadLine());
  20.  
  21. double money = 0;
  22.  
  23. double wins = 0;
  24. double loses = 0;
  25.  
  26. for (int i = 1; i <= days; i++)
  27. {
  28. double moneyPerDay = 0;
  29.  
  30. string sports = Console.ReadLine();
  31.  
  32. double counterW = 0;
  33. double counterL = 0;
  34.  
  35. while (sports != "Finish")
  36. {
  37. string result = Console.ReadLine();
  38.  
  39. if (result == "win")
  40. {
  41. moneyPerDay += 20;
  42. counterW++;
  43. wins++;
  44. }
  45.  
  46. else if (result == "lose")
  47. {
  48. counterL++;
  49. loses++;
  50. }
  51.  
  52. sports = Console.ReadLine();
  53.  
  54.  
  55. }
  56.  
  57. if (counterW > counterL)
  58. {
  59. money += moneyPerDay + (moneyPerDay * 0.1);
  60. }
  61.  
  62. else
  63. {
  64. money += moneyPerDay;
  65. }
  66.  
  67. }
  68.  
  69. if (wins > loses)
  70. {
  71. money += money * 0.2;
  72. Console.WriteLine($"You won the tournament! Total raised money: {money:f2}");
  73. }
  74.  
  75. else if (loses > wins)
  76. {
  77. Console.WriteLine($"You lost the tournament! Total raised money: {money:f2}");
  78. }
  79.  
  80. }
  81. }
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement