fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_SIZE = 10000;
  5.  
  6. int main() {
  7. int n, k, v[MAX_SIZE + 1], check[MAX_SIZE + 1];
  8. cin >> n;
  9. for (int i = 1; i <= n; ++i) {
  10. cin >> v[i];
  11. }
  12. cin >> k;
  13. for (int j = 1; j <= k; ++j) {
  14. cin >> check[j];
  15. for (int i = 1; i <= n; ++i) {
  16. if (check[j] == v[i]) {
  17. cout << check[j] << " se afla in sir \n";
  18. check[j] = -1;
  19. }
  20. }
  21. if (check[j] > -1) {
  22. cout << check[j] << " nu se afla in sir \n";
  23. }
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 5288KB
stdin
5
7 9 10 3 5
3
5 10 15
stdout
5 se afla in sir 
10 se afla in sir 
15 nu se afla in sir