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