思路:不多说了。。。。
代码如下:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define p 3.1415927
int main(int argc, char *argv[])
{
int n,d,u;
int i;
int time;
while(scanf("%d%d%d",&n,&u,&d) && n!=0)
{
time=0;
for(i=0;i<n;)
{
i+=u;
time++;
if(i>=n)
break;
time++;
i-=d;
}
printf("%d\n",time);
}
return 0;
}