Advertisement
Zinak

Untitled

Jun 18th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int i,j,k,l,m,sum,mx,a[6][6];
  6. mx=-1;
  7. for(i=0; i<6; i++)
  8. {
  9. for(j=0; j<6; j++)
  10. {
  11. cin>>a[i][j];
  12. }
  13. }
  14.  
  15. for(int o=0; i<=3; i++)
  16. {
  17. for(int p=0; p<=3; p++)
  18. {
  19. k=a[o][p]+a[o][p+1]+a[o][p+2];
  20. l=a[o+1][p+1];
  21. m=a[o+2][p]+a[o+2][p+1]+a[o+2][p+2];
  22. sum=k+l+m;
  23. if(sum>mx)
  24. mx=sum;
  25.  
  26. }
  27. }
  28. cout<<mx<<endl;
  29. return 0;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement