Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. const int MAXN = 4000;
  5. long int A[3][MAXN];
  6. int main() {
  7.     int n, count = 0, y, u[3];
  8.     for (int i = 0; i < 3; i++) {
  9.         cin >> n;
  10.         u[i] = n;
  11.         for (int g = 0; g < n; g++) {
  12.             cin >> A[i][g];
  13.         }
  14.         y = n;
  15.     }
  16.     for (int z = 0; z < y; z++) {
  17.         bool o = 0, q = 0;
  18.         for (int j = 0; j < u[0]; j++) {
  19.             if (A[2][z] == A[0][j]) {
  20.                 o = 1;
  21.                 break;
  22.             }
  23.         }
  24.         for (int x = 0; x < u[1]; x++) {
  25.             if (A[2][z] == A[1][x])
  26.                 q = 1;
  27.         }
  28.         if (q == 1 && o == 1)
  29.             count++;
  30.     }
  31.     cout << count;
  32.     system("pause");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement