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 90305121 at 2003-11-24 23:04:39 on Problem 1006
#include <stdio.h>
main()
{
    int p,e,i,d,n,m,x;
    for (x=0;;)
	{scanf("%d %d %d %d",&p,&e,&i,&d);
	if(p==-1 && e==-1 && i==-1 &&d==-1)	break;
	else {
              x++;
	     for (n=21252;;)
	          if((n-p)%23==0&&(n-e)%28==0&&(n-i)%33==0)
		 {	
                    m=n-d;
		  break;
		  }
                    else n--;
        printf("case %d: the next triple peak occurs in %d days\n",x,m);
	      }
           }
}

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