Advertisement
ZuRi4i

Untitled

Dec 5th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Football_League
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int stadionCapacity = int.Parse(Console.ReadLine());
  10. int fans = int.Parse(Console.ReadLine());
  11. double percentTotal = fans / stadionCapacity * 100;
  12.  
  13. double A = 0;
  14. double B = 0;
  15. double V = 0;
  16. double G = 0;
  17.  
  18. for (int i = 0; i < fans; i++)
  19. {
  20. string sector = Console.ReadLine();
  21.  
  22. if (sector == "A")
  23. {
  24. A ++;
  25. }
  26. else if (sector == "B")
  27. {
  28. B ++;
  29. }
  30. else if (sector == "V")
  31. {
  32. V ++;
  33. }
  34. else if (sector == "G")
  35. {
  36. G ++; ;
  37. }
  38. }
  39. double percentA = A / fans * 100;
  40. double percentB = B / fans * 100;
  41. double percentV = V / fans * 100;
  42. double percentG = G / fans * 100;
  43.  
  44.  
  45. Console.WriteLine($"{percentA:F2}%");
  46. Console.WriteLine($"{percentB:F2}%");
  47. Console.WriteLine($"{percentV:F2}%");
  48. Console.WriteLine($"{percentG:F2}%");
  49. Console.WriteLine($"{percentTotal:F2}%");
  50.  
  51.  
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement