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

[ EXP技术分享博客 ] 版权所有,转载请注明出处: http://exp-blog.com
原文地址:https://www.cnblogs.com/lyy289065406/p/2120461.html