Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace _8._02_ITCareer
- {
- class Program
- {
- static void Main(string[] args)
- {
- //treadmill -> 5899
- //cross trainer -> 1699
- //exercise bike -> 1789
- //dumbells -> 579
- int count = int.Parse(Console.ReadLine()); //5
- int sum = 0;
- for (int i = 1; i <= count; i++)
- {
- //какъв е, цената
- string name = Console.ReadLine();
- switch(name)
- {
- case "treadmill":
- sum += 5899;
- break;
- case "cross trainer":
- sum += 1699;
- break;
- case "exercise bike":
- sum += 1789;
- break;
- case "dumbbells":
- sum += 579;
- break;
- }
- }
- Console.WriteLine($"{sum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement