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

不可能不对呀?WA 有高手吗

Posted by UESTCCommunication at 2008-04-07 14:18:26 on Problem 1006
#include<stdio.h>
#include<stdlib.h> 
long int tpeak(int p,int e,int i,int d0) 
{
     p=p%23;   
     e=e%28;
     i=i%33;
     long int d=d0;
     d++;
    while(((d-p)%23!=0 || (d-e)%28!=0 || (d-i)%33!=0) && d-d0<21252 )  
    {
      d++;            
    }
  return   d-d0;
}
int main()
{
   int p[100],e[100],l[100],d[100]; 
   int sum,i=0;
   scanf("%d %d %d %d",&p[i],&e[i],&l[i],&d[i]); 
   while(p[i]!=-1)
   {
        i++;
        scanf("%d %d %d %d",&p[i],&e[i],&l[i],&d[i]);            
   }
   sum=i;
   for(i=0;i<sum;i++)
    printf("Case %d: the next triple peak occurs in %ld days.\n",i+1,tpeak(p[i],e[i],l[i],d[i]));
    return 0;
    
    
}

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