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 |
各位大侠,江湖救急,为什么sample对了,但是是wa呢?#include "Stdio.h" int main() { int p,e,i,d,k=0,day; do { scanf("%d%d%d%d",&p,&e,&i,&d); k++; if (p!=-1 && e!=-1 && i!=-1 && d!=-1) for(day=23;day<=21252;day++) { p=p%23;e=e%28;i=i%33; if (day%23==p && day%28==e && day%33==i) if (day-d>0) printf("Case %d: the next triple peak occurs in %d\n days.",k,day-d); } } while (p!=-1 && e!=-1 && i!=-1 && d!=-1); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator