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 |
各位高手帮帮忙,这题总是wrong answer。都崩溃了。#include<stdio.h> main(){ int num[4],i,j=1; long m; while(1) { for(i=0;i<4;i++) scanf("%d ",&num[i]); if((num[0]==-1)&&(num[1]==-1)&&(num[2]==-1)&&(num[3]==-1)) break; for(m=1;;m++) if(((m-num[0])%23==0)&&((m-num[1])%28==0)&&((m-num[2])%33==0)) { if(m-num[3]==0) printf("Case %d: the next triple peak occurs in 21512 days.\n",j); else printf("Case %d: the next triple peak occurs in %ld days.\n",j,m-num[3]); break; } j++; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator