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:tangbei at 2009-07-27 21:37:53 > #include<stdio.h> > #define N 7 > int main() > { > int p,e,i,d,j,t=1; > int k=0; > int a[N]; > while(p!=-1&&e!=-1&&i!=-1&&d!=-1) > { > scanf("%d %d %d %d",&p,&e,&i,&d); > for(j=d;j<=21252;j++) > { > if((j+d-p)%23==0&&(j+d-e)%28==0&&(j+d-i)%33==0&&j!=0) > { > a[t]=j; > t++; > } > } > k++; > } > for(t=1;t<k;t++) > printf("case %d:the next triple peak occurs in %d days\n",t,a[t]); > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator