杭电acm题_1.2.1 爬虫

来源:互联网 发布:北京部委公务员知乎 编辑:程序博客网 时间:2024/05/16 05:10
#include <iostream> //#include <stdio.h>using namespace std;int main() {    //freopen("debug\\in.txt", "r", stdin);//freopen("debug\\out.txt", "r", stdin);int n,u,d; while (cin>>n>>u>>d){if ( (n||u||d)==0)break;int t=1,l=0;for (t=1;l<n;t++){if (t%2)l+=u;else{l-=d;    if ((l+u)>=n){t++;break;}}}cout<<t<<endl;}//fclose(stdin);return 0; } 

 
	
				
		
原创粉丝点击