Advertisement
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 ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int capacitetOfStadium = int.Parse(Console.ReadLine());
- int countOfFens = int.Parse(Console.ReadLine());
- string A = "A";
- string B = "B";
- string V = "V";
- string G = "G";
- int fensSectorA = 0;
- int fensSectorB = 0;
- int fensSectorV = 0;
- int fensSectorG = 0;
- for (int i = 0; i < countOfFens; i++)
- {
- string sector = Console.ReadLine();
- if (sector == A)
- {
- fensSectorA += 1;
- }
- else if (sector == B)
- {
- fensSectorB += 1;
- }
- else if (sector == V)
- {
- fensSectorV += 1;
- }
- else if (sector == G)
- {
- fensSectorG += 1;
- }
- }
- double percentA = fensSectorA / countOfFens * 100;
- double percentB = fensSectorB / countOfFens * 100;
- double percentV = fensSectorV / countOfFens * 100;
- double percentG = fensSectorG / countOfFens * 100;
- double percentCapacitet = countOfFens / capacitetOfStadium * 100;
- Console.WriteLine($"{percentA}%");
- Console.WriteLine($"{percentB}%");
- Console.WriteLine($"{percentV}%");
- Console.WriteLine($"{percentG}%");
- Console.WriteLine($"{percentCapacitet}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement