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 test1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double allseats = double.Parse(Console.ReadLine());
- double allfans = double.Parse(Console.ReadLine());
- double fansA = 0;
- double fansB = 0;
- double fansV = 0;
- double fansG = 0;
- for (int i = 0; i < allfans; i++)
- {
- string sector = Console.ReadLine();
- switch (sector)
- {
- case "A": fansA = fansA + 1; break;
- case "B": fansB = fansB + 1; break;
- case "V": fansV = fansV + 1; break;
- case "G": fansG = fansG + 1; break;
- }
- }
- fansA = (fansA/allfans) * 100;
- fansB = (fansB / allfans) * 100;
- fansV = (fansV / allfans) * 100;
- fansG = (fansG / allfans) * 100;
- allfans = (allfans / allseats) * 100;
- Console.WriteLine("{0:f2}%", fansA);
- Console.WriteLine("{0:f2}%", fansB);
- Console.WriteLine("{0:f2}%", fansV);
- Console.WriteLine("{0:f2}%", fansG);
- Console.WriteLine("{0:f2}%", allfans);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement