Advertisement
mbah_bejo

TA

Nov 26th, 2019
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {long long p,l,i,j,k,lo,alat,i1,j1;
  5.     scanf("%lld%lld",&p,&l);
  6.     long long arr[111][111],temp=0,sum=0;
  7.     for(i=0;i<l;i++)
  8.     {
  9.         for(j=0;j<p;j++)
  10.         {
  11.             scanf("%lld",&arr[i][j]);
  12.        
  13.         }
  14.     } scanf("%lld",&alat);
  15.  
  16.     for(i1=0;i1<(l-alat+1);i1++)
  17.     {
  18.         for(j1=0;j1<(p-alat+1);j1++)
  19.         {
  20.             for(k=0;k<alat;k++)
  21.             {
  22.                 for(lo=0;lo<(alat);lo++)
  23.                 {
  24.                     temp+=arr[k+i1][lo+j1];
  25.                     //printf("%lld-",temp);
  26.                 }
  27.             } if(sum<temp)sum=temp; temp=0;
  28.         }
  29.     } printf("%lld\n",sum);
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement