Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- // Da se ispechati redicata so najgolema suma.
- int main()
- {
- int i,j,m,n,a[100][100],zbir,flag,red,maxizbir,sum;
- sum = 0;
- scanf("%d%d", &m, &n);
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- scanf("%d", &a[i][j]);
- }
- }
- for(i=0;i<n;i++)
- {
- zbir = 0;
- for(j=0;j<m;j++)
- {
- zbir += a[i][j];
- }
- if(flag)
- {
- maxizbir = zbir;
- red = i;
- flag = 0;
- }
- if(zbir > maxizbir)
- {
- maxizbir = zbir;
- red = i;
- }
- }
- for(j=0;j<m;j++)
- {
- // printf("Redica so najgolema suma:");
- printf("%d\n", a[red][j]);
- }
- printf("%d\n", maxizbir);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement