http://acm.hdu.edu.cn/showproblem.php?pid=1049
分析:
小学数学题,直接用模拟做
代码:
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<iostream>
#define LL long long
using namespace std;
int n,u,d;
int main()
{
// freopen("in.txt","r",stdin);
int ans,s;
while(scanf("%d%d%d",&n,&u,&d)!=EOF){
if(!n) return 0;
ans=0;
for(int i=0;i<n;){
i+=u;
ans++;
if(i>=n) break;
i-=d;
ans++;
}
printf("%d\n",ans);
}
return 0;
}