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

求救!WA了很多次但检查不出来有神马错误

Posted by aa2985759 at 2010-11-03 16:25:28 on Problem 1006
#include<iostream>
using namespace std;
int main()
{
	int *p,*e,*i,*d,p1,e1,i1,d1,j=0,k;

	p=new int[100];
	e=new int[100];
	i=new int[100];
	d=new int[100];

	cin>>p1>>e1>>i1>>d1;
	while(p1+1)
	{
		p[j]=p1%23;
		e[j]=e1%28;
		i[j]=i1%33;
		d[j]=d1;
		j++;
		cin>>p1>>e1>>i1>>d1;
	}

	for(k=0;k<j;k++)
	{
		while(p[k]!=e[k])
		{
			if(p[k]>e[k])
				e[k]+=28;
			else p[k]+=23;
		}
		while(e[k]!=i[k])
		{
			if(e[k]>i[k])
				i[k]+=33;
			else e[k]+=644;
		}
		cout<<"Case "<<<k+1<<": the next triple peak occurs in "<<(i[k]>d[k]?i[k]-d[k]:i[k]-d[k]+21252)<<" days."<<endl;
	}
}

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