Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int m,n,k,i1,j1,i2,j2,i,j,max=0,s;
  6. int cirese[101][101];
  7. cin>>n>>m>>k;
  8. for (i=1; i<=n; i++)
  9. {
  10. for (j=1; j<=m; j++)
  11. {
  12. cin>>cirese[i][j];
  13. }
  14. }
  15. while(k>0)
  16. {
  17. cin>>i1>>j1>>i2>>j2;
  18. s=0;
  19. for (i=i1; i<=i2; i++)
  20. {
  21. for(j=j1; j<=j2; j++)
  22. {
  23. s+=cirese[i][j];
  24. }
  25. }
  26. if(s>max)
  27. {
  28. max=s;
  29. }
  30. k--;
  31. }
  32. cout<<max;
  33. return 0;
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement