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 |
Why WA ??#include <stdio.h> #define P 23 #define E 28 #define I 33 void main() { int ca=1; int p,e,i,d; while(1){ p%=P; p+=P; scanf("%d %d %d %d",&p,&e,&i,&d); if(p==-1) break; while(p <=d || (p-e)%E || (p-i)%I ) p+=P; printf("Case %d: the next triple peak occurs in %d days.\n",ca++,p-d); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator