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 |
这是我写的1006题的C代码,但老是过不去,求高手指点#include<stdio.h> void main() { int p,e,i,k=1,n=0,d; long int t; while(k) { scanf("%d%d%d%d",&p,&e,&i,&d); if(p==-1||e==-1||i==-1||d<0||d>365) break; else{ for(++n,t=d+1;t<=21252+d;t++) if((t-p)%23==0&&(t-e)%28==0&&(t-i)%33==0) break; printf("case %d:the next peak is %ld days\n",n,t-d); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator