Pagini recente » Cod sursa (job #216563) | Cod sursa (job #777286) | Cod sursa (job #619597) | Borderou de evaluare (job #1007029) | Cod sursa (job #378557)
Cod sursa(job #378557)
#include<iostream.h>
#include<fstream.h>
int main()
{
ifstream f("zoo.in");
ofstream g("zoo.out");
long i,j,nr,n,m,x1,x2,y1,y2;
struct s{int x;int y;} v[16001];
f>>n;
for(i=0;i<n;i++)
f>>v[i].x>>v[i].y;
f>>m;
for(i=0;i<m;i++)
{f>>x1>>y1>>x2>>y2;
nr=0;
for(j=0;j<n;j++)
if(x1<=v[j].x)
if(v[j].x<=x2)
if(y1<=v[j].y)
if(v[j].y<=y2) nr++;
g<<nr<<endl;
}
f.close();
g.close();
return 0;
}