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

为什么WA啊? 谢谢!!!!

Posted by y05yxg at 2006-08-19 11:39:55 on Problem 2980
#include<iomanip.h>
#include<math.h>
int main()
{
	double n1,n2,n3,r,sum;
	cin>>n1>>n2>>n3>>r;
	while(n1!=0||n2!=0||n3!=0||r!=0)
	{
		sum=0;
		if(n1*2>n2)
		{
			sum=
				n1*ceil(100/(r+2))
				+n2*ceil((100-floor(100/(r+2))*(r-1))/r+floor(100/(r+2)))
				+n3*ceil(100/r);
		}
		else	if(n1*2==n2)
		{
			double sum1=0,sum2=0;
			sum1=(n1+n2+n3)*ceil(100/r);
			sum2=
				n1*ceil(100/(r+2))
				+n2*ceil((100-floor(100/(r+2))*(r-1))/r+floor(100/(r+2)))
				+n3*ceil(100/r);
			if(sum1<=sum2)
			{
				sum=sum1;
			}
			else
			{
				sum=sum2;
			}
		}
		else
		{
			sum=(n1+n2+n3)*ceil(100/r);
		}
		cout<<sum<<endl;
		cin>>n1>>n2>>n3>>r;
	}
	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