http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1048
没啥好说的。
#include <iostream>
using namespace std;
int main()
{
float m;
float total = 0.0;
int count = 0;
while(cin >> m) {
total += m;
count++;
if(12 == count) {
total = total/12.00;
cout << "$" << total << endl;
total = 0.0;
count = 0;
}
}
return 0;
}