#include<iostream>
using namespace std;
int main()
{
int n,u,d,s,t;
while(cin>>n>>u>>d&&n>0)
{
for ( s=0,t=1;s+u<n;t+=2,s+=u-d );
cout<<t<<endl;
}
return 0;
}
Saturday, 21 March 2009
HOJ ( acm.hdu.edu.cn ) 1049
Subscribe to:
Post Comments (Atom)
我爱水题,爱死水题了。
#include<iostream>
using namespace std;
int main()
{
int n,u,d,s,t;
while(cin>>n>>u>>d&&n>0)
{
for ( s=0,t=1;s+u<n;t+=2,s+=u-d );
cout<<t<<endl;
}
return 0;
}
No comments:
Post a Comment