Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Practicing
- {
- class Program
- {
- static void Main(string[] args)
- {
- double stadionCapacity = int.Parse(Console.ReadLine());
- double fansNumber = int.Parse(Console.ReadLine());
- int sectorA = 0;
- int sectorB = 0;
- int sectorV = 0;
- int sectorG = 0;
- for (int i = 0; i < fansNumber; i++)
- {
- char fanSector = char.Parse(Console.ReadLine());
- if (fanSector == 'A')
- sectorA++;
- if (fanSector == 'B')
- sectorB++;
- if (fanSector == 'V')
- sectorV++;
- if (fanSector == 'G')
- sectorG++;
- }
- var aPercent = 100 / (fansNumber / sectorA);
- var bPercent = 100 / (fansNumber / sectorB);
- var vPercent = 100 / (fansNumber / sectorV);
- var gPercent = 100 / (fansNumber / sectorG);
- var filledCapacity = 100 / (stadionCapacity / fansNumber);
- Console.WriteLine($"{aPercent:f2}%");
- Console.WriteLine($"{bPercent:f2}%");
- Console.WriteLine($"{vPercent:f2}%");
- Console.WriteLine($"{gPercent:f2}%");
- Console.WriteLine($"{filledCapacity:f2}%");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment