又是水题。。看来POJ开头的都是水题啊~
#include <stdio.h> int main() { freopen("1.txt", "r", stdin); float sum = 0, t; int m = 0; while( scanf("%f", &t) != EOF ) { sum += t; m++; } printf("$%.2f\n", sum/m); }
又是水题。。看来POJ开头的都是水题啊~
#include <stdio.h> int main() { freopen("1.txt", "r", stdin); float sum = 0, t; int m = 0; while( scanf("%f", &t) != EOF ) { sum += t; m++; } printf("$%.2f\n", sum/m); }