#include<iostream>
using namespace std;
double ans,t,H,D,U,F;
int main()
{
while(cin>>H>>U>>D>>F&&H)
{
ans=0.0;t=0;
F=F*U/100.0;
while(ans>=0.0)
{
t++;
if(U>0)ans+=U;
if(ans>H)break;
ans-=D;
U-=F;
}
if(ans<0)
cout<<"failure on day "<<t<<endl;
else
cout<<"success on day "<<t<<endl;
}
}
uva-573 反思一下,好好读题
最新推荐文章于 2019-07-22 00:32:41 发布