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 glaver at 2003-12-03 20:56:25 on Problem 1006

#include "Stdio.h"

main()
{ int i,ii;
  int a,b,c,d;
  int aa,bb,cc;
  ii=0;
  scanf("%d %d %d %d",&a,&b,&c,&d);
  while(a!=-1||b!=-1||c!=-1||d!=-1)
  {ii++;
   aa=0;
   bb=0;
   cc=0;
   if(a!=b||b!=c)
  {aa=23-a%23;
   bb=(a%23-b-23+28)%28;
   cc=(a%23-c-23+33)%33;}
  i=0;
  while(bb!=0||cc!=0)
      {i+=23;
       bb=(bb<23)? bb+5:bb-23;
       cc=(cc<23)? cc+10:cc-23;
       }
  printf("Case %d: the next triple peak occurs in %d days.\n",ii,(21252-i-d-aa));
 scanf("%d %d %d %d",&a,&b,&c,&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