标签:input rate tle sam color lin class rest count
#include <iostream> #include <algorithm> #include <stdio.h> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <ctype.h> using namespace std; int main() { int n,u,d; while(scanf("%d%d%d",&n,&u,&d)&&n&&u&&d) { int res=n,t=1; res-=u; while(res) { if(t>=2) { res-=u; t++; } if(res<=0) break; res+=d; t++; } printf("%d\n",t); } return 0; }
标签:input rate tle sam color lin class rest count
原文地址:http://www.cnblogs.com/gonsedup/p/7262348.html