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题的C代码,但老是过不去,求高手指点

Posted by 1160443573 at 2012-03-08 21:06:09 on Problem 1006
#include<stdio.h>
void main()
{
 int p,e,i,k=1,n=0,d;
 long int t;
 while(k)
 {
  scanf("%d%d%d%d",&p,&e,&i,&d);
  if(p==-1||e==-1||i==-1||d<0||d>365)
   break;
  else{
	   for(++n,t=d+1;t<=21252+d;t++)
		if((t-p)%23==0&&(t-e)%28==0&&(t-i)%33==0)
		 break;
	   printf("case %d:the next peak is %ld days\n",n,t-d);
	  }
 }

}

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