码迷,mamicode.com
首页 > 其他好文 > 详细

Roy&October之取石子

时间:2019-09-12 23:33:00      阅读:85      评论:0      收藏:0      [点我收藏+]

标签:https   int   思路   一个   stdin   algorithm   names   print   就是   

【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 }

 

Roy&October之取石子

标签:https   int   思路   一个   stdin   algorithm   names   print   就是   

原文地址:https://www.cnblogs.com/66dzb/p/11515462.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!