1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】14.指针2/7-1 C程序设计 实验5-7 数组指针作函数参数.c

22 lines
311 B
C

#include <stdio.h>
int main() {
int m, n;
scanf("%d%d", &m, &n);
for (int i = 1; i <= m; i++) {
int sum = 0;
for (int j = 1, x; j <= n; j++) {
scanf("%d", &x);
sum += x;
}
printf("%d %.1lf\n", sum, 1.0 * sum / n);
}
return 0;
}