Advertisement
Josif_tepe

Untitled

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