标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2188
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 6813 Accepted Submission(s): 4297
简单题,不多说,直接上代码
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <stack> 5 #include <queue> 6 #include <map> 7 #include <set> 8 #include <vector> 9 #include <cmath> 10 #include <algorithm> 11 using namespace std; 12 #define ll long long 13 const double eps = 1e-6; 14 const double pi = acos(-1.0); 15 const int INF = 0x3f3f3f3f; 16 const int MOD = 1000000007; 17 18 int main () 19 { 20 int T,n,m; 21 while (scanf ("%d",&T)==1) 22 { 23 while (T--) 24 { 25 scanf ("%d%d",&n,&m); 26 if (n <= m) 27 printf ("Grass\n"); 28 else 29 { 30 if (n%(m+1)) 31 printf ("Grass\n"); 32 else 33 printf ("Rabbit\n"); 34 } 35 } 36 } 37 return 0; 38 }
标签:
原文地址:http://www.cnblogs.com/dxd-success/p/4707397.html