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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int A = 0;
- int B = 0;
- int V = 0;
- int G = 0;
- int afafa = 0;
- int guests = int.Parse(Console.ReadLine());
- int gifts = int.Parse(Console.ReadLine());
- for (int i = 0; i < gifts; i++)
- {
- String command = Console.ReadLine();
- if (command == "A")
- {
- A += 1;
- }
- else if (command == "B")
- {
- B += 1;
- }
- else if (command == "V")
- {
- V += 1;
- }
- else if (command == "G")
- {
- G += 1;
- }
- else {
- afafa++;
- }
- }
- double Aperct = A / gifts * 100.0;
- double Bperct = B / gifts * 100.0;
- double Vperct = V / gifts * 100.0;
- double Gperct = G / gifts * 100.0;
- double afaPerc = afafa / gifts * 100.0;
- Console.WriteLine($"{Aperct:f2}%");
- Console.WriteLine($"{Bperct:f2}%");
- Console.WriteLine($"{Vperct:f2}%");
- Console.WriteLine($"{Gperct:f2}%");
- Console.WriteLine($"{afaPerc:f2}%");
- double countGuests = gifts / guests * 100.0;
- Console.WriteLine($"{countGuests:f2}%");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement