北大acm1004

还是很兴奋地用了map.....

题目链接:http://poj.org/problem?id=1004

Source Code

Problem: 1004   User: yuanting0505
Memory: 252K   Time: 16MS
Language: C++   Result: Accepted
    • Source Code
#include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, const char * argv[])
{
    float accout[12];
    float sum=0;
    int i=0;
    while(i<12)
    {
        cin>>accout[i];
        sum+=accout[i];
        i++;
    }
    float average=sum/12.0;
    cout<<"$"<<setiosflags(ios::fixed)<<setprecision(2)<<average<<endl;
    return 0;
}
posted @ 2013-07-30 11:18  OT元旦  阅读(265)  评论(0编辑  收藏  举报