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