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 |
Re:为什么会WA??大虾帮忙~~~~In Reply To:为什么会WA??大虾帮忙~~~~ Posted by:ACrun at 2007-01-16 12:16:29 #include<iostream> using namespace std; int main() { long s,d,temp,flag; while(cin>>s>>d&&(d!=0&&s!=0)) { if(s<d){temp=s;s=d;d=temp;} if(s/d>=2)cout<<"Stan wins"<<endl; flag=0; while(s%d!=0) { temp=s; s=d; d=temp%d; flag++; } if(flag%2)cout<<"Ollie wins"<<endl; else cout<<"Stan wins"<<endl; } return 0; } 这是我的算法。他也是wa。哪个大牛给几个关键数据测试下。我测试了n久都没发现错误~ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator