Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
注意这道题目在两个数相等时候的情况还是需要再判断如果a 是 b的两倍 或者相等的情况毫无疑问是先取先赢 但是如果是a / b == 1 的情况就不一样了 还需要再判断 while ( a / b == 1 ) { win++; int c = a; a = b; b = c % b; if ( b == 0 ) break; } 接着如果又是a 是 b的两倍就可以判断出来了 或者 b == 0 时 那么就是 另一个赢 我刚通过~ Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator