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 |
为何总是run time error 我觉得循环次数不是很多阿#include <iostream.h> void main() { static int a[100],b[100],c[100],d[100]; int i=0; int t=1; while (a[i]!=-1) { i++; cin>>a[i]>>b[i]>>c[i]>>d[i]; while (t<=644) { if ((c[i]+33*t-a[i])%23==0&&(c[i]+33*t-b[i])%28==0) break; else t++; } } for (int j=1;j<i;j++) cout<<"Case "<<j<<": the next triple peak occurs in "<<c[j]+33*t-a[j]<<" days."<<endl; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator