Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n,m,i,j;
- float sl[60];
- float sc[60];
- float v[60][60];
- float a,b,ma,mb;
- int main()
- {
- cin>>n>>m;
- for (i=1;i<=n;i++)
- {
- for (j=1;j<=m;j++)
- {
- cin>>v[i][j];
- sl[i]+=v[i][j];
- sc[j]+=v[i][j];
- }
- }
- for (i=1;i<=n;i++)
- {
- for (j=1;j<=m;j++)
- {
- a=(sc[j-1]-(sc[n]-sc[j]))
- if (a<0)
- a=-a;
- b=(sl[i-1]-(sl[m]-sl[i])
- if (b<0)
- b=-b;
- if (a<=ma && b<=mb)
- {
- ma=a;
- mb=b;
- c1=i;
- c2=j;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement