Advertisement
Guest User

Untitled

a guest
May 27th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace proiect
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n, m, i, j;
  14. n = int.Parse(Console.ReadLine());
  15. m = int.Parse(Console.ReadLine());
  16. int[] t = new int[n];
  17. int[] s = new int[m];
  18.  
  19. for (i = 0; i < n; i++)
  20. {
  21. t[i] = int.Parse(Console.ReadLine());
  22. }
  23. for (j = 0; j < m; j++)
  24. {
  25. s[j] = int.Parse(Console.ReadLine());
  26. }
  27. for (j = 0; j < m; j++)
  28. {
  29. int ok = 0;
  30. for (i = 0; i < n && ok == 0; i++)
  31. {
  32. if ( s[j] == t[i] )
  33. ok = 1;
  34. }
  35. Console.WriteLine(ok + " ");
  36.  
  37. }
  38.  
  39.  
  40.  
  41. Console.ReadKey();
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement