Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

帮我看看错在哪里,不胜感激!!!

Posted by 890905 at 2009-07-17 10:15:08
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator