gabi11

Sets & Dictionaries Advanced - 03. Periodic Table

May 19th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace Advanced
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             var periodicTable = new SortedSet<string>();
  15.  
  16.             int number = int.Parse(Console.ReadLine());
  17.  
  18.             for (int i = 0; i < number; i++)
  19.             {
  20.                 var elements = Console.ReadLine().Split();
  21.  
  22.                 foreach (var element in elements)
  23.                 {
  24.                     periodicTable.Add(element);
  25.                 }
  26.             }
  27.  
  28.             Console.WriteLine(string.Join(" ", periodicTable));
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment