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 |
Re:哪位好心人能告诉我错哪了呢?我都要疯了In Reply To:哪位好心人能告诉我错哪了呢?我都要疯了 Posted by:90303115 at 2003-11-16 15:05:47 > #include<stdio.h> > void main() > { > int p,e,i,d,y,l[100],a=1,b=1,c; > while(1){ ----------------------------------------〉死循环,没出口 > scanf("%d %d %d %d",&p,&e,&i,&d); > if(p==-1&&e==-1&&i==-1&&d==-1) > {while(b<=a);---------------------------------> 是;还是{ > b++; > printf(" the next triple peak occurs in %d days\n",l[b]); > } > else{ > a++; > y=d+1; > while (((y-p)%23==0&&(y-e)%28==0&&(y-i)%33==0)==0) ---〉少{ > y++; ------------------->每次加1,算法超时 > l[a]=y-d;}} > > } > > 此外,程序风格太差,括号要上下对齐! 此题可参考课程主页的参考资料,已经给出中文的算法和程序。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator