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