Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FitnessCenter
- {
- class Program
- {
- static void Main(string[] args)
- {
- int visitors = int.Parse(Console.ReadLine());
- int back = 0;
- int chest = 0;
- int legs = 0;
- int abs = 0;
- int proteinShake = 0;
- int proteinBar = 0;
- for (int i = 0; i < visitors; i++)
- {
- string action = Console.ReadLine();
- switch (action)
- {
- case "Back":
- back++;
- break;
- case "Chest":
- chest++;
- break;
- case "Legs":
- legs++;
- break;
- case "Abs":
- abs++;
- break;
- case "Protein shake":
- proteinShake++;
- break;
- case "Protein bar":
- proteinBar ++;
- break;
- }
- }
- Console.WriteLine($"{back} - back");
- Console.WriteLine($"{chest} - chest");
- Console.WriteLine($"{legs} - legs");
- Console.WriteLine($"{abs} - abs");
- Console.WriteLine($"{proteinShake} - protein shake");
- Console.WriteLine($"{proteinBar} - protein bar");
- Console.WriteLine($"{(double)(back + chest + legs + abs) / visitors * 100:F2}% - work out");
- Console.WriteLine($"{(double)(proteinShake + proteinBar) / visitors * 100:F2}% - protein");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement