Răspuns :
#include <iostream>
using namespace std;
int a[100], b[100], c[200];int n, m;
int main(){ /** Problema 1 int i;
cin >> n; for(i = 1; i <= n; i++) cin >> a[i];
cin >> m; for(i = 1; i <= m; i++) cin >> b[i];
int k = 1, j; for(i = 1; i <= n; i++) { bool gasit = false; int x = a[i]; for(j = 1; j <= m; j++) if(x == b[j]) gasit = true;
if(gasit == true) c[k] = a[i], k++;
}
k--; for(i = 1; i <= k; i++) cout << c[i] << " "; */
/** Problema 2
int i;
cin >> n; for(i = 1; i <= n; i++) cin >> a[i];
cin >> m; for(i = 1; i <= m; i++) cin >> b[i];
int k = 1, j; for(i = 1; i <= n; i++) { bool gasit = true; int x = a[i]; for(j = 1; j <= m; j++) if(x == b[j]) gasit = false;
if(gasit == true) c[k] = a[i], k++;
}
k--; for(i = 1; i <= k; i++) cout << c[i] << " "; */
/** Problema 3
int i; cin >> n;
for(i = 1; i <= n; i++) cin >> a[i];
for(i = 1; i <= n; i++) if(a[i] % 2 == 0) cout << a[i] << " ";
cout << endl; for(i = 1; i <= n; i++) if(a[i] % 2 == 1) cout << a[i] << " "; */
/** Problema 4
int i, d; cin >> n >> d;
for(i = 1; i <= n; i++) cin >> a[i];
for(i = 1; i <= n; i++) if(a[i] % d == 0) cout << a[i] << " "; */
/** Problema 5 int i; cin >> n; for(i = 1; i <= n; i++) cin >> a[i];
double mp = 0, mn = 0, nr1 = 0, nr2 = 0;
for(i = 1; i <= n; i++) if(a[i] >= 0) mp += a[i], nr1++; else if(a[i] < 0) mn += a[i], nr2++;
cout << mp / nr1 << " " << mn / nr2; */ return 0;}
using namespace std;
int a[100], b[100], c[200];int n, m;
int main(){ /** Problema 1 int i;
cin >> n; for(i = 1; i <= n; i++) cin >> a[i];
cin >> m; for(i = 1; i <= m; i++) cin >> b[i];
int k = 1, j; for(i = 1; i <= n; i++) { bool gasit = false; int x = a[i]; for(j = 1; j <= m; j++) if(x == b[j]) gasit = true;
if(gasit == true) c[k] = a[i], k++;
}
k--; for(i = 1; i <= k; i++) cout << c[i] << " "; */
/** Problema 2
int i;
cin >> n; for(i = 1; i <= n; i++) cin >> a[i];
cin >> m; for(i = 1; i <= m; i++) cin >> b[i];
int k = 1, j; for(i = 1; i <= n; i++) { bool gasit = true; int x = a[i]; for(j = 1; j <= m; j++) if(x == b[j]) gasit = false;
if(gasit == true) c[k] = a[i], k++;
}
k--; for(i = 1; i <= k; i++) cout << c[i] << " "; */
/** Problema 3
int i; cin >> n;
for(i = 1; i <= n; i++) cin >> a[i];
for(i = 1; i <= n; i++) if(a[i] % 2 == 0) cout << a[i] << " ";
cout << endl; for(i = 1; i <= n; i++) if(a[i] % 2 == 1) cout << a[i] << " "; */
/** Problema 4
int i, d; cin >> n >> d;
for(i = 1; i <= n; i++) cin >> a[i];
for(i = 1; i <= n; i++) if(a[i] % d == 0) cout << a[i] << " "; */
/** Problema 5 int i; cin >> n; for(i = 1; i <= n; i++) cin >> a[i];
double mp = 0, mn = 0, nr1 = 0, nr2 = 0;
for(i = 1; i <= n; i++) if(a[i] >= 0) mp += a[i], nr1++; else if(a[i] < 0) mn += a[i], nr2++;
cout << mp / nr1 << " " << mn / nr2; */ return 0;}