Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Footbal
- {
- class Program
- {
- static void Main(string[] args)
- {
- var capacity = int.Parse(Console.ReadLine());
- var numbers = double.Parse(Console.ReadLine());
- var A = 0;
- var B = 0;
- var V = 0;
- var G = 0;
- for (int i = 0; i < numbers; i++)
- {
- var count = Console.ReadLine().ToLower();
- if (count == "a")
- {
- A += 1;
- }
- if (count == "b")
- {
- B += 1;
- }
- if (count == "v")
- {
- V += 1;
- }
- if (count == "g")
- {
- G += 1;
- }
- }
- var porcentageA = A / numbers * 100;
- Console.WriteLine($"{porcentageA:f2}%");
- var porcentageB = B / numbers * 100;
- Console.WriteLine($"{porcentageB:f2}%");
- var porcentageV = V / numbers * 100;
- Console.WriteLine($"{porcentageV:f2}%");
- var porcentageG = G / numbers * 100;
- Console.WriteLine($"{porcentageG:f2}%");
- var stadiumPorcentage = numbers / capacity * 100;
- Console.WriteLine($"{stadiumPorcentage:f2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment