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