Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int sum = 0;
- int tdm = 5899;
- int ctr = 1699;
- int exb = 1789;
- int dumb = 579;
- string[] uredi = new string[4];
- uredi[0] = "treadmill";
- uredi[1] = "cross trainer";
- uredi[2] = "exercise bike";
- uredi[3] = "dumbbells";
- for (int i = 0; i < n; i++)
- {
- var arr = Console.ReadLine();
- if (arr == uredi[0]) sum += tdm;
- else if (arr == uredi[1]) sum += ctr;
- else if (arr == uredi[2]) sum += exb;
- else if (arr == uredi[3]) sum += dumb;
- }
- Console.WriteLine("{0:f2}", sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement