ZOJ Problem Set - 1048

来源:互联网 发布:淘宝代理货源怎么找 编辑:程序博客网 时间:2024/04/28 17:16

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;
}

原创粉丝点击