#include<stdio.h>
int main(){ int n,u,d; while(scanf("%d%d%d",&n,&u,&d),n) { int t=(n-u)/(u-d); if(t*(u-d)<(n-u)) t++; t*=2; t++; printf("%d\n",t); } return 0;}本文共 217 字,大约阅读时间需要 1 分钟。
#include<stdio.h>
int main(){ int n,u,d; while(scanf("%d%d%d",&n,&u,&d),n) { int t=(n-u)/(u-d); if(t*(u-d)<(n-u)) t++; t*=2; t++; printf("%d\n",t); } return 0;}转载于:https://www.cnblogs.com/wangkun1993/p/6291387.html