POJ1004-Financial Management

转载请注明出处:優YoU http://user.qzone.qq.com/289065406/blog/1309072514

 

额。。还真怀念。。这都遇上了。。2011年5月ACM珠海赛的试机题= =

别问我怎么做,求平均数而已,水过水过。。。

毫无悬念,当时题目都没看,一看到Sample Input和Sample Output就直接A了= =

 

 1 //Memory Time 
2 //256K 0MS
3
4 #include<iostream>
5 #include<iomanip>
6 using namespace std;
7
8 int main(void)
9 {
10 double sum=0.0;
11 for(int i=1;i<=12;i++)
12 {
13 double temp;
14 cin>>temp;
15 sum+=temp;
16 }
17 cout<<fixed<<setprecision(2)<<'$'<<sum/12.0<<endl;
18 return 0;
19 }

posted on 2011-07-28 23:29  小優YoU  阅读(164)  评论(0编辑  收藏  举报

导航