Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Dictionary<string, int> uredi = new Dictionary<string, int>();
- uredi.Add("treadmill", 5899);
- uredi.Add("cross trainer", 1699);
- uredi.Add("dumbbells", 579);
- uredi.Add("exercise bike", 1789);
- int n = int.Parse(Console.ReadLine());
- int sum = 0;
- string input = "";
- for (int i = 0; i < n; i++)
- {
- input = Console.ReadLine();
- if (uredi.ContainsKey(input))
- {
- sum += uredi[input];
- }
- }
- Console.WriteLine($"sum:f2");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement