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

为什么总是WrongAnswer啊!!我测试明明都对

Posted by xucyi at 2004-11-09 23:37:13 on Problem 1006
#include"stdio.h"
int Num_p,p,e,i,d,Rlt,Case;
void main(){
for (Case=1;Case<123412341;Case++)
 {scanf("%d %d %d %d",&p,&e,&i,&d);
   if ((p==-1&&e==-1&&i==-1&&d==-1)==1) break;
     else {for(Num_p=1;Num_p<=28*33;Num_p++)
	 {        if(((p+Num_p*23-e)%28==0&&(p+Num_p*23-i)%33==0)==1)
                 
	             break;}
	 
	 
	 }
      Rlt=21252-(21252-Num_p*23-p)-d;
      printf("Case %d: the next triple peak occurs in %d days.\n",Case,Rlt);
}	  
}

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