Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace _06.AMinerTask
- {
- class MinerTask
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- Dictionary<string, long> collected = new Dictionary<string, long>();
- while (input != "stop")
- {
- if (!collected.ContainsKey(input))
- {
- collected.Add(input, 0);
- }
- collected[input] += long.Parse(Console.ReadLine());
- input = Console.ReadLine();
- }
- foreach (var pair in collected)
- {
- Console.WriteLine("{0} -> {1}", pair.Key, pair.Value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement