巴士博弈 hdoj

题目链接:https://vjudge.net/problem/HDU-2149

参考代码:

#include <iostream>
#include <cstdio>
using namespace std;
int main() {
	int m,n,mod;
	while(scanf("%d %d",&m,&n)!=EOF) {
		mod = m%(n+1);
		if(mod == 0)
			printf("none\n");
		else if(mod==m) {
			for(int i = m; i <= n; i++) {
				if(i==n)
				printf("%d\n",i);
				else
				printf("%d ",i);
			}
		}
		else
		printf("%d\n",mod);
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_40624026/article/details/81415257
今日推荐