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:为什么下面这段程序在自己的环境里没问题,叫了就wronganswer呢?In Reply To:为什么下面这段程序在自己的环境里没问题,叫了就wronganswer呢? Posted by:ljl08 at 2007-07-22 12:25:31 #include<iostream> using namespace std; int main() { int p,e,i,d,m=0; cin>>p>>e>>i>>d; while(!(p==-1&&e==-1&&i==-1&&d==-1)) { m++; int n; for( n=1;n<=924;n++) { if ( ((p+23*n)-e )%28==0 && ((p+23*n)-i )%33==0) { if(p+23*n<21252) cout<<"Case "<<m<<": the next triple peak occurs in "<<p+23*n-d<< " days."<<endl; else cout<<"Case "<<m<<": the next triple peak occurs in 21252 days."<<endl; break; } } cin>>p>>e>>i>>d; } return 0; } 这是我的程序在自己环境里面运算和我用同学答案提交的程序计算出来的结果都是一样的,但是一直是WA,把我也给郁闷的.....只要自己想清楚了就行.. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator