Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace CommonElements
  6. {
  7. class CommonElements
  8. {
  9. static void Main()
  10. {
  11. string[] array1 = Console.ReadLine().Split();
  12. string[] array2 = Console.ReadLine().Split();
  13.  
  14. foreach (var a2 in array2)
  15. {
  16. foreach (var a1 in array1)
  17. {
  18. if (a2 == a1)
  19. {
  20. Console.Write($"{a2} ");
  21. }
  22. }
  23. }
  24.  
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement