Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Football_League
- {
- class Program
- {
- static void Main(string[] args)
- {
- int stadionCapacity = int.Parse(Console.ReadLine());
- int fans = int.Parse(Console.ReadLine());
- double percentTotal = fans / stadionCapacity * 100;
- double A = 0;
- double B = 0;
- double V = 0;
- double G = 0;
- for (int i = 0; i < fans; i++)
- {
- string sector = Console.ReadLine();
- if (sector == "A")
- {
- A ++;
- }
- else if (sector == "B")
- {
- B ++;
- }
- else if (sector == "V")
- {
- V ++;
- }
- else if (sector == "G")
- {
- G ++; ;
- }
- }
- double percentA = A / fans * 100;
- double percentB = B / fans * 100;
- double percentV = V / fans * 100;
- double percentG = G / fans * 100;
- Console.WriteLine($"{percentA:F2}%");
- Console.WriteLine($"{percentB:F2}%");
- Console.WriteLine($"{percentV:F2}%");
- Console.WriteLine($"{percentG:F2}%");
- Console.WriteLine($"{percentTotal:F2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement