Cod sursa(job #93416)

Utilizator bobo_2dan horia bobo_2 Data 18 octombrie 2007 19:42:57
Problema Plantatie Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include<fstream.h>

long  int a[500][500],i,j,n,m,l,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];

    for(i=1;i<=m;i++)
     {  long b,c;              max=0;
     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;
}