Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int price = 0;
- for(int i = 0; i < n; i++)
- {
- string command = Console.ReadLine();
- if(command == "treadmill")
- {
- price += 5899;
- }
- else if(command == "cross trainer")
- {
- price += 1699;
- }
- else if(command == "exercise bike")
- {
- price += 1789;
- }
- else if(command == "dumbbells")
- {
- price += 579;
- }
- }
- Console.WriteLine("{0:F2}", price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement