Josif_tepe

Untitled

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