Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Wedding_Presents
- {
- class Program
- {
- static void Main()
- {
- var guests = int.Parse(Console.ReadLine());
- var presents = double.Parse(Console.ReadLine());
- var countMony = 0d;
- var countEl = 0d;
- var countVouch = 0d;
- var countOthers = 0d;
- for (int i = 1; i <= presents; i++)
- {
- var type = Console.ReadLine();
- switch (type)
- {
- case "A":
- countMony++;
- break;
- case "B":
- countEl++;
- break;
- case "V":
- countVouch++;
- break;
- case "G":
- countOthers++;
- break;
- default:break;
- }
- }
- countMony /= presents / 100;
- countEl /= presents / 100;
- countVouch /= presents / 100;
- countOthers /= presents / 100;
- Console.WriteLine($"{countMony:F2}%");
- Console.WriteLine($"{countEl:F2}%");
- Console.WriteLine($"{countVouch:F2}%");
- Console.WriteLine($"{countOthers:F2}%");
- Console.WriteLine($"{presents / guests * 100:F2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment