巴什博奕(Bash Game)

巴什博奕(Bash Game)

类似题目链接(杭电4764):http://acm.hdu.edu.cn/showproblem.php?pid=4764
代码如下:

#include<iostream>
#include<cstring>
using namespace std;
/*巴什博弈*/
int main()
{
	int n,m;
	while(cin>>n>>m)
	{
		if(n==0&&m==0)   break;
		if(n%(m+1)==1)  cout<<"后手胜"<<endl;
		else cout<<"先手胜"<<endl;
	}
	return 0;
 } 

猜你喜欢

转载自blog.csdn.net/qq_39905917/article/details/84670920