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 |
请各位牛人帮忙看一下,为什么总是WA???#include<iostream> using namespace std; int main() { int count; int a,b,c,d; int ans[10000]; int index=0; cin>>count; for(int m=0;m<count;m++) { index=0; cin>>a>>b>>c>>d; while(!((a==-1)&&(b==-1)&&(c==-1)&&(d==-1))) { int temp; if(c) temp=c; else temp=33; bool flag=true; while(flag) { if(((temp-a)%23==0)&&((temp-b)%28==0)) flag=false; else temp+=33; } if((temp-d>0)&&(temp-d)<=21252) ans[index++]=temp-d; else if(temp-d<=0) ans[index++]=temp-d+21252; else ans[index++]=temp-d-21252; cin>>a>>b>>c>>d; } for(int i=0;i<index;i++) cout<<"Case "<<(i+1)<<": the next triple peak occurs in "<<ans[i]<<" days."<<endl; } } 上面是我的代码 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator