| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
帮我看看错在哪里,不胜感激!!!#include <iostream.>
#include <iomanip>
using namespace std;
int main()
{
double sum=0,n,ave=0;
int i=0,k=0;
for(i=0;i<12;i++)
{
cin>>n;
sum+=n;
}
ave=sum/12;
cout<<'$';
if((ave-(int)ave)/0.01>0.5)
ave+=0.01;
cout<<setprecision(2)<<ave;
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator