Cod sursa(job #93418)
| Utilizator | Data | 18 octombrie 2007 19:46:59 | |
|---|---|---|---|
| Problema | Plantatie | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream.h>
long int a[500][500],i,j,n,m,max;
ifstream f("plantatie.in");
ofstream g("plantatie.out");
int main()
{ long o,oo,ooo,x,y,l;
f>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
f>>a[i][j];
long b,c; max=0;
for(i=1;i<=m;i++)
{
f>>x>>y>>l;
for(c=x;c<l+x;c++)
for(b=y;b<l+y;b++)
{ if(a[c][b]>max) max=a[c][b];
}
g<<max<<"\n";
}
f.close();
g.close();
return 0;
}
