Pagini recente » Cod sursa (job #2125167) | Cod sursa (job #414842) | Cod sursa (job #267370) | Cod sursa (job #1716565) | Cod sursa (job #21473)
Cod sursa(job #21473)
#include<iostream.h>
#include<fstream.h>
int main()
{
ifstream f("zoo.in");
ofstream g("zoo.out");
long i,j,x,n,m,x1,x2,y1,y2;
struct s1{int c;int d;} a[16000];
f>>n;
for(i=0;i<n;i++)
f>>a[i].c>>a[i].d;
f>>m;
for(i=0;i<m;i++)
{f>>x1>>y1>>x2>>y2;
x=0;
for(j=0;j<n;j++)
if(x1<=a[j].c && a[j].c<=x2 && y1<=a[j].d && a[j].d<=y2) x++;
g<<x<<endl;
}
f.close();
g.close();
return 0;
}