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

麻烦各位高手帮我看一下为什么这样写是错的! 谢谢!

Posted by tangbei at 2009-07-27 21:37:53 on Problem 1006
#include<stdio.h>
#define N 7
int main()
{
	int p,e,i,d,j,t=1;
	int k=0;
	int a[N];
	while(p!=-1&&e!=-1&&i!=-1&&d!=-1)
	{
	   scanf("%d %d %d %d",&p,&e,&i,&d);  
       for(j=d;j<=21252;j++)
			{
		       if((j+d-p)%23==0&&(j+d-e)%28==0&&(j+d-i)%33==0&&j!=0)
			   {
				  a[t]=j;
			      t++;
			   }
			}
	   k++;
	}
	 for(t=1;t<k;t++)
		   printf("case %d:the next triple peak occurs in %d days\n",t,a[t]);
  return 0;
}

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