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;
- }
- }
- }
- 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