Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

c语言的源代码

Posted by 1115267126 at 2016-03-07 01:06:08 on Problem 1006
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator