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:实在没办法了:help..谢谢了

Posted by 00448242 at 2005-07-28 12:49:51 on Problem 1006
In Reply To:Re:实在没办法了:help..谢谢了 Posted by:ACM05001_dz0302 at 2005-07-28 12:46:34
> #include"stdio.h"
>  void main()
>  { 
> 	 
> 	 int a,b,c,d,i,j=0,n;
> 
>  while(1){
> 	 scanf("%d%d%d%d",&a,&b,&c,&d);j++;
> 
> 
>  if(a==-1&&b==-1&&c==-1&&d==-1) break;
> 
>  
>  
>  for(i=0;i<644;i++)//就是设定(周期为33的intellectual cycles)今年的第一个峰值是从
> 	 //上次3者相遇以来经过的第i个周期。644=23*28,21252=23*28*33
>  {if(((i*33-c%33+b%28)%28==0)&&((i*33-c%33+a%23)%23==0))
> 	 break;}
> 
>  
>  
>  
>  
>  n=21252-(33*i-c%33+d);
> printf("Case %d: the next triple peak occurs in %d days.\n",j,n);
>  
>  }
> 
>  }

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