Advertisement
Josif_tepe

Untitled

Aug 19th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #inclue<stdio.h>
  2. #defne MAX 100
  3. int main() {
  4.     int i,j,n,m;
  5.     int matrica[MAX][MAX];
  6.     int max = 0;
  7.     int sum = 0;
  8.     scanf("%d %d",&n,&m);
  9.     for(i=0;i<n;i++) {
  10.         for(j=0;j<m;j++) {
  11.             scanf("%d",&matrica[i][j]);
  12.         }
  13.     }
  14.     for(j=0;j<m;j++) {
  15.         for(i=0;i<n;i++) {
  16.             sum+=matrica[i][j];
  17.         }
  18.         if(sum>max) {
  19.             max=sum;
  20.         }
  21.         sum = 0;
  22.     }
  23.     printf("%d",max);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement