| ||||||||||
| 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 | |||||||||
请问是不是时间要求完成不了,或者内存的完成不了就WR了郁闷中,测试了可以过
而且我的代码和正确的长得也差不多...
FT
帖一下我的
#include < iostream.h >
#include < math.h >
void main()
{
int p,e,i,d,nCount=0;
for(;;){
cin >> p >> e >> i >> d;
if(p == -1 && e == -1 && i == -1 && d == -1)break;
nCount++;
for(int j = 1;j <= 21252;j ++){
if( (j - p)% 23 == 0 &&(j - e)% 28 ==0 &&(j - i) % 33 == 0)
cout<<"Case "<< nCount <<": the next triple peak occurs in "
<< j - d<<" days. "<<endl;
}
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator