| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
怎样才能令它不超时呢?救命啊#include<math.h>
#include<stdio.h>
void main(){
int p,e,i,d,n,k,m,date,endp;
n=1;
do{ scanf("%d %d %d %d",&p,&e,&i,&d);
endp=0,m=0,date=d+1;
while(endp!=1&&p!=-1){
if((date-p)%23==0&&(date-e)%28==0&&(date-i)%33==0){
printf("Case %d: the next triple peak occurs in %d days.\n",n,date-d);
endp=1;
n=n+1;
}
date=date+1;
}
}while(p!=-1&&e!=-1&&i!=-1&&d!=-1);
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator