Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

A Multiplication Game/곽병학

From ZeroWiki
#include<iostream>
using namespace std;

int main() {
	int turn =1;
	long double n;
	while(cin>>n) {
		while(1) {
			n /= turn%2 == 1 ? 9.0 : 2.0;
			turn++;
			if(n <= 1) break;
		}
		switch(turn %2) {
			case 0:
				cout<<"Stan wins."<<endl;
				break;
			case 1:
				cout<<"Ollie wins."<<endl;
				break;
		}
		turn =1;
	}
}