#include #include int main(int argc, char *argv[]) { char line[1024]; double cumsum = 0; while (fgets(line, sizeof(line), stdin)) { if ((line[0] >= '0' && line[0] <= '9') || line[0] == '.') { cumsum += atof(line); printf("%f\n", cumsum); } } }