Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n, i, m=0;
cin >> n;
int x[n], y[n];
for (i=0; i<n; i++) {
cin >> x[i];
if ((x[i]<100 && x[i]>-100) || (x[i]<=-1000) || (x[i]>=1000)) {
y[m++]=x[i];
}
}
for (i=0; i<m; i++) {
cout << y[i] << " ";
}
return 0;
}
Explicație: