Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace CommonElements
- {
- class CommonElements
- {
- static void Main()
- {
- string[] array1 = Console.ReadLine().Split();
- string[] array2 = Console.ReadLine().Split();
- foreach (var a2 in array2)
- {
- foreach (var a1 in array1)
- {
- if (a2 == a1)
- {
- Console.Write($"{a2} ");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement