10 2 1 20 3 1 0 0 0
17 19源代码:#include <stdio.h> #include <stdlib.h> int main() { int n,u,d,p,t; while(scanf("%d%d%d",&n,&u,&d) && n!=0) { t=0,p=0; while(u<=n) { p=p+u; t++; if(p>=n) break; else { p=p-d; t++; } } printf("%d\n",t); } system("pause"); return 0; }
原文地址:http://blog.csdn.net/zchlww/article/details/42672665