Cod sursa(job #21473)
Utilizator | Mihail Costea mihail_costea | Data | 23 februarie 2007 18:22:05 |
---|---|---|---|
Problema | Zoo | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#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;
}