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题的程序哪里错了?

Posted by lailiangyu at 2009-01-19 10:24:39 and last updated at 2009-01-19 10:28:13
main()
{
  int p,e,i,d;
  int a=0,b,t[365];
  while(1)
  {  scanf("%d%d%d%d",&p,&e,&i,&d);
     if(p==-1&&e==-1&&i==-1&&d==-1)
       break;
     else
       for(i=i+33;;i=i+33)
       {  if((i-e)%28==0)
	  { if((i-p)%23==0)
	    {  t[a]=i-d;
	       a++;
	       break;
	    }
	    else  continue;
	  }
	  else continue;
       }
  }
  for(b=a,a=0;a<b;a++)
    printf("\nCase %d: the next triple peak occurs in %d days.",a+1,t[a]);
}

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