Advertisement
STANAANDREY

missing nr

Aug 29th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  long a[1201],b[1201],i;
  4.  
  5. int main()
  6. {
  7. int n,m,i,j,ok,p=0;
  8. cin>>n>>m;
  9. for (i=0;i<n;i++)
  10. cin>>a[i];
  11. for (i=0;i<n-m;i++)
  12. cin>>b[i];
  13.  
  14. for (i=0;i<n;i++)
  15. {
  16.     ok=1;
  17.     for (j=0;j<n-m&&ok;j++)
  18.     if (a[i]==b[j])
  19.         ok=0;
  20.     if (ok)
  21.     {
  22.         p=1;
  23.         cout<<a[i]<<' ';
  24.     }
  25. }
  26. if (!p)
  27. cout<<"Nu s-au pierdut date";
  28. return 0;
  29. }
  30. //*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement