#include <stdio.h> int main() { float a, sum = 0; int n = 0; //简单题型不需要那么难吧,节约时间和空间复杂度远比算法复杂度好 while (scanf("%f", &a) != EOF) { printf("%.1f ", a); sum += a; n++; if (n == 5) { printf("%.1f\n",sum); sum = 0; n = 0; } } return 0; }