Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- const int MAXN = 4000;
- long int A[3][MAXN];
- int main() {
- int n, count = 0, y, u[3];
- for (int i = 0; i < 3; i++) {
- cin >> n;
- u[i] = n;
- for (int g = 0; g < n; g++) {
- cin >> A[i][g];
- }
- y = n;
- }
- for (int z = 0; z < y; z++) {
- bool o = 0, q = 0;
- for (int j = 0; j < u[0]; j++) {
- if (A[2][z] == A[0][j]) {
- o = 1;
- break;
- }
- }
- for (int x = 0; x < u[1]; x++) {
- if (A[2][z] == A[1][x])
- q = 1;
- }
- if (q == 1 && o == 1)
- count++;
- }
- cout << count;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement