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 1234K at 2005-03-22 09:48:48 on Problem 1006
#include<math.h>
main()
{int p,e,i,d,j=0;
 do
 {scanf("%d",&p);
  scanf("%d",&e);
  scanf("%d",&i);
  scanf("%d",&d);
  if(p!=-1&&e!=-1&&i!=-1&&d!=-1)
   {j++;
    p=p+23;
    e=e+28;
    while(e<p||(e-p)%23!=0)
     {e=e+28;
      }

    i=i+33;
    while(i<e||(i-e)%28!=0||(i-p)%23!=0)
     {i=i+33;
     }
    printf("Case %d: the next triple peak occurs in %d days.\n",j,i-d);
   }
 }while(p!=-1&&e!=-1&&i!=-1&&d!=-1);

getch();
}

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