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 a,b,c,d; int i=0; int j=0; while(1) { scanf("%d%d%d%d",&a,&b,&c,&d); if(a!=-1||b!=-1||c!=-1) { j+=1; while(((d-a)%23)!=0||((d-b)%28!=0)||((d-c)%33!=0)||d==0) { d+=1; i+=1; } printf("Case %d: the next triple peak occurs in %d days.\n",j,i); i=0; } else { break; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator