| ||||||||||
| 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 | |||||||||
为什么WA啊? 谢谢!!!!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator