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

为什么这个程序老是提示wrong answer,偶觉得没有错呀!

Posted by A0317210 at 2004-01-07 22:35:45 on Problem 1006
#include <stdio.h>
main()
{
int p,e,i,d;
int k=28*33*23;
int x,t=0;
scanf("%d %d %d %d",&p,&e,&i,&d);
while(p!=-1||e!=-1||i!=-1||d!=-1)
{
t=t+1;
for(x=1;x<=k;x++)
{if((x-p)%23==0&&(x-e)%28==0&&(x-i)%33==0)
printf("Case %d: the next triple peak occurs in %d days.\n",t,x-d);
}
scanf("%d %d %d %d",&p,&e,&i,&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