poj-A Funny Game

在這裏插入圖片描述AC代碼:

//poj-A Funny Game 
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main(){
	int n;
	while(scanf("%d",&n)!=EOF)
	{	
		if(n==0) break;
		else if(n>=3) cout<<"Bob\n";//大於等於三時第二個人如果佔據n/2的位置,第一個人怎麼也贏不了了 
		else cout<<"Alice\n";
	}
	return 0;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章