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());
- string activity = Console.ReadLine();
- int totalTraining = 0;
- int back = 0;
- int chest = 0;
- int legs = 0;
- int abs = 0;
- int proteinShake = 0;
- int proteinBar = 0;
- int workout = 0;
- int protein = 0;
- for (int i = 1; i <= visitors; i++)
- {
- activity = Console.ReadLine();
- if (activity == "Back")
- {
- back++;
- totalTraining++;
- }
- if (activity == "Chest")
- {
- chest++;
- totalTraining++;
- }
- if (activity == "Legs")
- {
- legs++;
- totalTraining++;
- }
- if (activity == "Abs")
- {
- abs++;
- totalTraining++;
- }
- if (activity == "Protein shake")
- {
- proteinShake++;
- }
- if (activity == "Protein bar")
- {
- proteinBar++;
- }
- if (activity == "Work out")
- {
- workout += workout;
- }
- if (activity == "Protein")
- {
- protein++;
- }
- }
- double percent = (totalTraining * 1.0 / visitors) * 100;
- double percentPerProtein = (protein * 1.0 / visitors) * 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($"{percent:f2}% - work out");
- Console.WriteLine($"{percentPerProtein:f2}% - protein");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment