Traditional Culture Encyclopedia - Almanac inquiry - Kneel for perpetual calendar-Gregorian calendar converter C language code! ! !

Kneel for perpetual calendar-Gregorian calendar converter C language code! ! !

# include & ltstdio.h & gt

# include & ltconio.h & gt

# include & ltstdlib.h & gt

int IsLeapYear(int);

int main()

{

int I;

int day

Cross-year;

int temp

int temp _ I;

long int Year _ days = 0;

int Year _ Start = 1;

Interest per _ _ _ year _ day;

int month _ day【】= { 3 1,28,3 1,30,3 1,30,3 1,30,3 1,30,3 1,29 };

Printf ("Please enter year:");

Scanf ("%d", & year);

while(Year _ Start & lt; Year)

{

if(is leapy Year(Year _ Start))

Every _ year _ day = 366;

other

Every _ year _ day = 365;

YYY = YYY+YYY;

year _ start++;

}

for(temp = 1; Temperature < =12; Temperature++)

{

Switch (temperature)

{

Case 1:

Printf ("January (%d)\ n", year);

Break;

Case 2:

Printf ("February (%d)\ n", year);

Break;

Case 3:

Printf ("March (%d)\ n", year);

Break;

Case 4:

Printf ("April (%d)\ n", year);

Break;

Case 5:

printf(“May(% d)\ n“,year);

Break;

Case 6:

Printf ("June (%d)\ n", year);

Break;

Case 7:

Printf ("July (%d)\ n", year);

Break;

Case 8:

Printf ("August (%d)\ n", year);

Break;

Case 9:

Printf ("September (%d)\ n", year);

Break;

Case 10:

Printf ("October (%d)\ n", year);

Break;

Case 1 1:

Printf ("November (%d)\ n", year);

Break;

Case 12:

Printf ("December (%d)\ n", year);

Break;

}

I = Year _ days % 7;

Printf ("Monday Tuesday Wednesday Thursday Fri Saturday \ n");

If (me! = 0 )

for(temp _ I = 0; Temp _ i< me; temp_i++)

printf(“”);

day = 1;

If (after one year) & Temperature == 2)

while(day & lt; = month _ day [12])

{

if(day & gt; 1 )

if(Year _ days % 7 = = 0)

printf(“\ n“);

if(day & gt; = 10 )

printf(“% d“,day);

other

printf(“% d“,day);

year _ days++;

day++;

}

other

while(day & lt; = month _ day【temp- 1】)

{

if(day & gt; 1 )

if(Year _ days % 7 = = 0)

printf(“\ n“);

if(day & gt; = 10 )

printf(“% d“,day);

other

printf(“% d“,day);

year _ days++;

day++;

}

printf(“\ n“);

if(getch()= =‘q‘)

Exit (0);

}

getch();

}

straddle over the year

{

if((year % 4 = = 0)& amp; & (year% 100! = 0) ||

(Year% 400 == 0))

Returns1;

other

Returns 0;

}