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 ConsoleApplication65
- {
- class Program
- {
- static void Main(string[] args)
- {
- SortedDictionary<string, int> players = new SortedDictionary<string, int>();
- while (true)
- {
- string[] command = Console.ReadLine().Split(' ', '-').Where(znak => znak != " ").ToArray();
- if (command[0] == "End")
- {
- break;
- }
- if (players.ContainsKey(command[0]))
- {
- players[command[0]] += int.Parse(command[3]);
- }
- else
- players.Add(command[0],int.Parse(command[3]));
- }
- foreach(var item in players)
- Console.WriteLine("{0} -> {1}",item.Key,item.Value);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement