| ||||||||||
| 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 | |||||||||
c语言的源代码#include<stdio.h>
int main()
{
int i1,i2,i3,n;
int j,j1,j2;
int z,z1;
z1=1;
int a[1000]={0};
while(1)
{
scanf("%d %d %d %d",&i1,&i2,&i3,&n);
i1=i1%23;
i2=i2%28;
i3=i3%33;
j1=i2-i1;
if(i1<0)
break;
for(j=1;;j++)
{
j1+=5;
if(j1%23==0)
break;
}
z=i2+j*28;
for(j=0,j2=0;;j++)
{
z+=644;
if((z-i3)%33==0)
{
for(j=0;;j++)
{
if(z>=n)
{
j2=1;
break;
}
else
z+=21252;
}
}
if(j2==1)
break;
}
a[z1]=(z-n)%21252;
if(a[z1]==0)
a[z1]=21252;
z1++;
j1=0;
}
for(z=1;z<z1;z++)
printf("Case %d: the next triple peak occurs in %d days.\n",z,a[z]);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator