标签:
Description
Input
Output
Sample Input
Sample Output
1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<algorithm> 5 using namespace std; 6 int main() 7 { 8 int n,u,d; 9 while(scanf("%d%d%d",&n,&u,&d)&&(n||u||d)) 10 { 11 if((n-u)%(u-d)==0) 12 { 13 printf("%d\n",((n-u)/(u-d))*2+1); 14 } 15 else 16 { 17 printf("%d\n",((n-u)/(u-d))*2+3); 18 } 19 } 20 }
标签:
原文地址:http://www.cnblogs.com/guofeng1022/p/4240025.html