Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FootballLeague
- {
- class FootballLeague
- {
- static void Main(string[] args)
- {
- int stadionCapacy = int.Parse(Console.ReadLine());
- int totalFens = int.Parse(Console.ReadLine());
- double sectorA = 0;
- double sectorB = 0;
- double sectorV = 0;
- double sectorG = 0;
- for (int sector = totalFens - 1; sector >= 0; sector--)
- {
- string currentFenSector = Console.ReadLine();
- if (currentFenSector == "A")
- {
- sectorA++;
- }
- else if (currentFenSector == "B")
- {
- sectorB ++;
- }
- else if (currentFenSector == "V")
- {
- sectorV ++;
- }
- else // sector "G";
- {
- sectorG ++;
- }
- }
- Console.WriteLine($"{((sectorA / totalFens) * 100):F2}%");
- Console.WriteLine($"{((sectorB / totalFens) * 100):F2}%");
- Console.WriteLine($"{((sectorV / totalFens) * 100):F2}%");
- Console.WriteLine($"{((sectorG / totalFens) * 100):F2}%");
- Console.WriteLine($"{(((sectorA + sectorB + sectorG + sectorV) / stadionCapacy) * 100):F2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement