HDOJ 1846 Brave Game: http://acm.hdu.edu.cn/showproblem.php?pid=1846 在取石子问题上加了最大取石子数的限制。只要多写出几组数据就可以发现规律。 代码: #include<iostream> using namesapce std; int main() { int t,n,m,i; scanf("%d",&t); while(t--) { scanf("%d %d",&n,&m); if(n%(m+1)==0) printf("second/n"); else printf("first/n"); } return 0; }