题解 | #班级成绩输入输出#
班级成绩输入输出
https://www.nowcoder.com/practice/60d96b08e1cb42e38629d54e37eac008
#include <stdio.h> int main() { double a[5][5]; double sum[5]= {0}; for (int i = 0; i < 5; i ++ ) { for (int j = 0; j < 5; j ++ ) { scanf("%lf", &a[i][j]); sum[i] += a[i][j]; } } for (int i = 0; i < 5; i ++ ) { for (int j = 0; j < 5; j ++ ) { printf("%.1lf ", a[i][j]); } printf("%.1lf\n", sum[i]); } return 0; }