-
Notifications
You must be signed in to change notification settings - Fork 0
/
09.Remove Names
39 lines (37 loc) · 973 Bytes
/
09.Remove Names
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
class RemoveNames
{
static void Main()
{
List<string> namesOne = new List<string>();
string []firstNames=Console.ReadLine().Split();
for (int i = 0; i < firstNames.Length; i++)
{
namesOne.Add(firstNames[i]);
}
List<string> namesTwo = new List<string>();
string[] secondNames = Console.ReadLine().Split();
for (int i = 0; i < secondNames.Length; i++)
{
namesTwo.Add(secondNames[i]);
}
List<string>namesGeneral=new List<string>();
foreach (var item in namesOne)
{
if ( namesTwo.Contains(item))
{
continue;
}
else
{
namesGeneral.Add(item);
}
}
foreach (var item in namesGeneral)
{
Console.Write("{0} ",item);
}
Console.WriteLine();
}
}