Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace PeriodicTable
- {
- using System;
- using System.Collections.Generic;
- public class PeriodicTable
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- SortedSet<string> chemicalsSet = new SortedSet<string>();
- for (int i = 0; i < n; i++)
- {
- string[] chemicals = Console.ReadLine().Split(' ');
- foreach (var item in chemicals)
- {
- chemicalsSet.Add(item);
- }
- }
- foreach (var item in chemicalsSet)
- {
- Console.Write(item + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement