Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

1006题Runtime Error ,求大神指点

Posted by peter_czhang at 2012-10-11 17:27:33
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator