Josif_tepe

Untitled

Aug 28th, 2025
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5. #include <math.h>
  6. int main() {
  7.     int n, m;
  8.     scanf("%d%d", &n, &m);
  9.    
  10.     int mat[n][m];
  11.    
  12.     for(int i = 0; i < n; i++) {
  13.         for(int j = 0; j < m; j++) {
  14.             scanf("%d", &mat[i][j]);
  15.         }
  16.     }
  17.    
  18.     for(int i = 0; i < n; i++) {
  19.         int sum = 0;
  20.         for(int j = 0; j < m; j++) {
  21.             sum += mat[i][j];
  22.         }
  23.        
  24.         printf("%d\n", sum);
  25.        
  26.     }
  27.    
  28.    
  29.     return 0;
  30. }
  31.  
  32. /*
  33.  8
  34.  1.3 0.7  7.0   2.5  3.3  14.9  5.1  2.24
  35.  **/
  36.  
Advertisement
Add Comment
Please, Sign In to add comment