P4018 Roy&October之取石子

6的倍数不行,之间的数都可以到6的倍数,而6的倍数不能到6的倍数

#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#define inf 2147483647
#define N 1000010
#define p(a) putchar(a)
#define For(i,a,b) for(int i=a;i<=b;++i)
//by war
//2019.8.9
using namespace std;
int T,n;
void in(int &x){
    int y=1;char c=getchar();x=0;
    while(c<'0'||c>'9'){if(c=='-')y=-1;c=getchar();}
    while(c<='9'&&c>='0'){ x=(x<<1)+(x<<3)+c-'0';c=getchar();}
    x*=y;
}
void o(int x){
    if(x<0){p('-');x=-x;}
    if(x>9)o(x/10);
    p(x%10+'0');
}

signed main(){
    in(T);
    while(T--){
        in(n);
        if(n%6==0)
            puts("Roy wins!");
        else
            puts("October wins!");
    }
    return 0;
}

 

posted @ 2019-08-09 16:02  WeiAR  阅读(137)  评论(0编辑  收藏  举报