| ||||||||||
| 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 | |||||||||
给你改了一下In Reply To:各位大侠,江湖救急,为什么sample对了,但是是wa呢? Posted by:nan at 2005-07-22 09:40:10 #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)
{
p=p%23;e=e%28;i=i%33;
for(day=1;day<=21252;day++)
{
if ((day+d)%23==p && (day+d)%28==e && (day+d)%33==i)
{
printf("Case %d: the next triple peak occurs in %d days.\n",k,day);
break;
}
}
}
}
while (p!=-1 && e!=-1 && i!=-1 && d!=-1);
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator