刚开始只考虑到了n=m+1的情况,后来搜题解后发现 只要是n%(m+1)==0 Rabbit就可以获胜
悼念512汶川大地震遇难同胞——选拔志愿者

#include<iostream>
using namespace std;
const int maxn=1001;
int main()
{
    int t,n,m;
    while(cin>>t){
        while(t--){
            cin>>n>>m;
            if(n<=m) cout<<"Grass"<<endl;
            else{
                if(n%(m+1)==0) cout<<"Rabbit"<<endl;
                else cout<<"Grass"<<endl;
            }
        }
    }
    return 0;
}

相关文章:

  • 2022-01-14
  • 2022-01-29
  • 2022-01-12
  • 2021-12-06
  • 2021-11-12
  • 2021-08-25
猜你喜欢
  • 2021-06-17
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-09-11
  • 2021-06-18
  • 2021-08-18
相关资源
相似解决方案