Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fitness_Center
- {
- 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;
- int training = 0;
- int shopping = 0;
- for (int i = 0; i < visitors; i++)
- {
- string activity = Console.ReadLine();
- if (activity == "Back")
- {
- back++;
- training++;
- }
- else if (activity == "Chest")
- {
- chest++;
- training++;
- }
- else if (activity == "Legs")
- {
- legs++;
- training++;
- }
- else if (activity == "Abs")
- {
- abs++;
- training++;
- }
- else if (activity == "Protein shake")
- {
- proteinShake++;
- shopping++;
- }
- else if (activity == "Protein bar")
- {
- proteinBar++;
- shopping++;
- }
- }
- double percentWorkOut = (training * 1.0) / (training + shopping) *100;
- double percentProtein = (shopping * 1.0) / (training + shopping) *100;
- 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($"{percentWorkOut:f2}% - work out");
- Console.WriteLine($"{percentProtein:f2}% - protein");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement