HDU 1846 || HDU2188 ||HDU 2149 巴什博奕(Bash Game)

/*

HDU 2149 算是这三个题目中的典范;

代码很简单,关键在于思想。。。

*/


HDU 2149 代码:


#include <iostream>
using namespace std;

int main()
{
	int m,n;
	while(cin>>m>>n)
	{
		
		if(n>=m)
		{
			cout<<m;
			for(int i = m+1; i <= n; i++)
				cout<<" "<<i;
			cout<<endl;
		}
		else
		{
			if(m%(n+1))
			{
				cout<<m%(n+1)<<endl;
			}
			else
			puts("none");
		}
	}
}


你可能感兴趣的:(HDU 1846 || HDU2188 ||HDU 2149 巴什博奕(Bash Game))