Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01._Fitness_Equipment
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int countEquipment = int.Parse(Console.ReadLine());
- //повтаряме: вид + цена
- int sum = 0; //обща сума за всички уреди
- for (int equipment = 1; equipment <= countEquipment; equipment++)
- {
- string equipmentName = Console.ReadLine();
- //• Пътека за бягане (treadmill) -> 5899 $
- //• Кростренажор(cross trainer)->1699 $
- //• Колело(exercise bike)-> 1789 $
- //• Комплект дъмбели(dumbbells) -> 579 $
- if (equipmentName == "treadmill")
- {
- sum += 5899;
- }
- else if (equipmentName == "cross trainer")
- {
- sum += 1699;
- }
- else if (equipmentName == "exercise bike")
- {
- sum += 1789;
- }
- else if (equipmentName == "dumbbells")
- {
- sum += 579;
- }
- }
- Console.WriteLine($"{sum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment