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 |
我来贴一个一次AC的 超级简短 的代码#include<stdio.h> int main(){ int e,p,i,d,t=0,k; while(scanf("%d %d %d %d",&p,&e,&i,&d)&&(p!=-1 ||e!=-1||i!=-1||d!=-1)) { t++; for(k=1;k<=21252;k++) if((k+d-p)/23*23+p-d==k && (k+d-e)/28*28+e-d==k && (k+d-i)/33*33+i-d==k) break; printf("Case %d: the next triple peak occurs in %d days.\n",t,k); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator