其他分享
首页 > 其他分享> > POJ - 2505 A multiplication game

POJ - 2505 A multiplication game

作者:互联网

https://vjudge.net/problem/POJ-2505

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	int n;
	while(cin>>n)
	{
		int f=0;
		while(n>1)
		{
			if(f)
			{
				if(n%2==0) n=n/2;  //向上取整 
				else n=n/2+1;	
			}
			else
			{
				if(n%9==0) n=n/9;
				else n=n/9+1;	
			}
			f=!f;
		}
   		if(f) cout<<"Stan wins.\n";
        else cout<<"Ollie wins.\n";
	}
	return 0; 
}

标签:int,n%,else,POJ,multiplication,2505,include
来源: https://blog.csdn.net/weixin_52341477/article/details/120104752