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 MinerTask
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- var dict = new Dictionary<string, int>();
- while (input != "stop")
- {
- if (dict.ContainsKey(input))
- {
- dict[input] += int.Parse(Console.ReadLine());
- }
- else
- {
- dict[input] = int.Parse(Console.ReadLine());
- }
- input = Console.ReadLine();
- }
- Console.WriteLine(String.Join("\n", dict.Select(x => x.Key + " -> " + x.Value)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement