Răspuns:
#include <iostream>
using namespace std;
int main()
{
int a[101],n,T,i,j;
cin>>n;
for(i=1;i<=n;i++)
cin>>a[i];
cin>>T;
for(i=1;i<=T;i++)
{
int x,y,nr=0;
cin>>x>>y;
for(j=1;j<=n;j++)
if(a[j]>=x && a[j]<=y)
nr++;
cout<<"Pentru intervalul ["<<x<<","<<y<<"] apartin "<<nr<<" numere din sir"<<endl;
}
return 0;
}