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 mily413312 at 2009-02-11 21:53:27 on Problem 1006 and last updated at 2009-02-11 22:07:28
#include <stdio.h>
int main()
{
  int p,e,i,d,j,t=1,x;
  while((scanf("%d%d%d%d",&p,&e,&i,&d))!=EOF)
  {
    if(p==-1 && e==-1 && i==-1 && d==-1)
		break;
	for(j=1;;j++)
		if((j+p)%23==0 && (j+e)%28==0 && (j+i)%33==0)
			break;
		x=21252-j-d;
    printf("Case %d: the next triple peak occurs in %d days.\n",t++,x);
  }
  return 0;
}
或者是(好像是一样的错误):
program mimi(input,output);
var
p,e,i,d,n,x,j:integer;
begin
j:=0;
while not eof do
 begin
 readln(p,e,i,d);
 if((p=-1)and(e=-1)and(i=-1)and(d=-1)) then break
 else
 begin
    j:=j+1;
    for n:=0 to 21252 do
    begin
       if(((n+p)mod 23=0)and((n+e)mod 28=0)and((n+i)mod 33=0))
       then break
    end;
    x:=21252-n-d;
    writeln('Case ',j,': the next triple peak occurs in ',x,' days.')
 end
 end
 end.

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