Roy&October之取石子

【TimeGate】

https://www.luogu.org/problem/P4018

【解题思路】

正解:只有是6的倍数就是第二个人赢,否则第一个人赢

【code】

 1 #include <cstdio>
 2 #include <iostream>
 3 #include <algorithm>
 4 using namespace std;
 5 int T,n;
 6 int main(){
 7     //freopen("4018.in","r",stdin);
 8     //freopen("4018.out","w",stdout);
 9     scanf("%d",&T);
10     while(T--){
11         scanf("%d",&n);
12         if(n%6!=0)printf("October wins!\n");
13         else printf("Roy wins!\n");
14     }
15     return 0;
16 }

猜你喜欢

转载自www.cnblogs.com/66dzb/p/11515462.html