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 & 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;
}
- Previous article:Dreaming that insects are afraid of themselves.
- Next article:Quan Min laohuangli app
- Related articles
- What's the next sentence in cockfighting city?
- How about picking up the car in May 2022 10?
- Who can sort out the major historical events in China from Yanhuang to modern times for me?
- Is tomorrow suitable for moving?
- 20 18 Christian Gregorian calendar
- What smart phones are suitable for the elderly?
- How about the second day of the fifth lunar month?
- Is September 15th of the lunar calendar in 2022 a good day for funeral?
- What is the lunar calendar on February 9, 2000 +65438?
- List of auspicious days in June 2020.
June 2020 is an auspicious day.
Gregorian calendar June 2, 2020 Lunar leap year April 1 1 Tuesday, 2020 Shanan, Ma Chong.
Appropriate: marriage,