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

Re:谁能帮我看看吗,怎么都过不去!

Posted by snake19851124 at 2007-11-17 16:33:31 on Problem 1004
In Reply To:谁能帮我看看吗,怎么都过不去! Posted by:wujitianya at 2007-11-17 14:29:54
will be rounded to the nearest penny, preceded immediately by a dollar sign, and followed by the end-of-line
输出少个$符号

> #include <iostream>
> using namespace std;
> 
> int main()
> {
> 	double m_month;
> 	int i=0;
> 	int temp;
> 	double sum=0;
> 	double average;
> 
> 	while (i!=12)
> 	{
> 		cin>>m_month;
> 		sum+=m_month;
> 		i++;
> 	}
> 	average=sum/12+0.005;
> 	
> 	temp=(int)average;//integer
> 	temp=(int)((average-temp)*100);        //decimal
> 	average=(int)average+(float)temp/100;          //average
> 
> 	cout<<average<<endl;
> 	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