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:Re:实在没办法了:help..谢谢了 Posted by:ACM05001_dz0302 at 2005-07-28 12:46:34 #include"stdio.h" void main() { int a,b,c,d,i,j=0,n; while(1){ scanf("%d%d%d%d",&a,&b,&c,&d);j++; if(a==-1&&b==-1&&c==-1&&d==-1) break; for(i=0;i<644;i++)//就是设定(周期为33的intellectual cycles)今年的第一个峰值是从 //上次3者相遇以来经过的第i个周期。644=23*28,21252=23*28*33 ~~~~~~~~~~~~~~~~上次3者相遇的时间又没有告诉你? {if(((i*33-c%33+b%28)%28==0)&&((i*33-c%33+a%23)%23==0)) break;} n=21252-(33*i-c%33+d); printf("Case %d: the next triple peak occurs in %d days.\n",j,n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator