| ||||||||||
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 |
1006题Runtime Error ,求大神指点#include<iostream> using namespace std; int main() { int j=0,k,t,p[7],e[7],i[7],d[7],remain[6]; cin>> p[j] >> e[j] >> i[j] >> d[j]; while(!((p[j]==-1)&&(e[j]==-1)&&(i[j]==-1)&&(d[j]==-1))) { j++; cin>> p[j] >> e[j] >> i[j] >> d[j]; } for(k=0;k<j;k++) { for(t=1;;t++) { if((33*t+(i[k]-p[k]))%23==0&&(33*t+(i[k]-e[k]))%28==0) break; } remain[k]=33*t+i[k]-d[k]; cout<<"Case "<< k+1 <<": the next triple peak occurs in "; cout<< remain[k] <<" days."<<endl; } return 0; } vc编译通过,运行无误,可是在平台上提交总是出错,唯一感觉可能出错的是字符数组定义大小,网上搜过其他人的做法,发现不用数组的话,基本上是输入一行,输出一行,不知道和题意相违背不?麻烦大神帮忙,看看本人程序问题出在什么地方?谢谢 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator