Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- Dictionary<String, List<String>> school = new Dictionary<String, List<String>>();
- while (true)
- {
- String[] command = Console.ReadLine().Split(' ');
- if (command[0] == "End")
- {
- break;
- }
- else if (command[0] == "Add")
- {
- String student = command[1];
- String paralelka = command[2];
- if (school.ContainsKey(paralelka))
- {
- school[paralelka].Add(student);
- }
- else
- {
- /*List<String> newParalelka = new List<String>();
- newParalelka.Add(student);
- school[paralelka] = newParalelka;*/
- school[paralelka] = new List<String>();
- school[paralelka].Add(student);
- }
- }
- }
- foreach (String paralelka in school.Keys)
- {
- Console.WriteLine("Class name: " + paralelka);
- foreach (String student in school[paralelka])
- {
- Console.WriteLine("###" + student);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement