1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【实践课内】8.数组2/7-2 求矩阵各行元素之和.c

22 lines
290 B
C
Raw Normal View History

2024-11-13 02:23:33 +00:00
#include <stdio.h>
int main() {
int m, n;
scanf("%d%d", &m, &n);
for (int i = 1; i <= m; i++) {
int x, sum = 0;
for (int j = 1; j <= n; j++) {
scanf("%d", &x);
sum += x;
}
printf("%d\n", sum);
}
return 0;
}