//输入输出一个班级五名学生五科成绩 #include <stdio.h> int main() { double arr[5][5] = {0};//五行五列数组储存 int i = 0; for (i = 0; i < 5; i++) { int j = 0; double sum = 0; for (j = 0; j < 5; j++) { scanf("%lf", &arr[i][j]); sum += arr[i][j]; printf("%.1lf ",arr[i][j]); } printf("%.1lf",sum); if(j==5)//每行最后打印空格 printf("\n"); } return 0; }