Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Common_Elements
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string[] input_1 = Console.ReadLine().Split();
  11. string[] input_2 = Console.ReadLine().Split();
  12.  
  13. foreach (string str_2 in input_2)
  14. {
  15. for (int i = 0; i < input_1.Length; i++)
  16. {
  17. if (str_2 == input_1[i])
  18. {
  19. Console.Write(str_2 + " ");
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement