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 |
请问这道题目..我用这样的GCD函数。。有错吗?int gcd(int m,int n) { if(m<0) m=-m; if(n<0) n=-n; int num; if(m>n) { while(n) { num=n; n=m%n; m=num; } return m; } else if(n>m) { while(m) { num=m; m=n%m; n=num; } return n; } } ///这个..测试样例是没问题..只是..WA了..保证其他地方是对的。 //麻烦大家帮忙看下感激感激 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator