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

Re:各位高手帮帮忙,这题总是wrong answer。都崩溃了。

Posted by hualichenxi at 2009-07-16 17:02:38 on Problem 1006
In Reply To:各位高手帮帮忙,这题总是wrong answer。都崩溃了。 Posted by:hualichenxi at 2009-07-14 09:51:26
> #include<stdio.h>
> main(){
> int num[4],i,j=1;
> long m;
> while(1)
> {
> 
>    for(i=0;i<4;i++)
>    scanf("%d ",&num[i]);
>    if((num[0]==-1)&&(num[1]==-1)&&(num[2]==-1)&&(num[3]==-1))
> break;
> 	for(m=1;;m++)
> 		if(((m-num[0])%23==0)&&((m-num[1])%28==0)&&((m-num[2])%33==0))
> 		{	if(m-num[3]==0)
> 			printf("Case %d: the next triple peak occurs in 21512 days.\n",j);
> 			else
> 
> 			printf("Case %d: the next triple peak occurs in %ld days.\n",j,m-num[3]);
> 		break;
> 		} 
> j++;
> }
> }

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