Traditional Culture Encyclopedia - The 24 Solar Terms - C language to generate calendar
C language to generate calendar
/* Adopt Win-TC compiler */
# include & ltstdio.h & gt
int main()
{
int a,n;
int m 1,m2,m3;
Printf ("Please enter the year (1997 ~1999):");
scanf("%d ",& ampa);
for(n = 1; n & lt= 12; n++)
{
printf("\n%d\n ",n);
Switch (n)
{
Case 1:
Case 3:
Case 5:
Case 7:
Case 8:
Case 10:
Case 12:
for(m 1 = 1; m 1 & lt; =3 1; m 1++)
{
printf("%d\t ",m 1);
if(m 1% 5 = = 0)printf(" \ n ");
}
putchar( 10);
Break;
Case 4:
Case 6:
Case 9:
Case 1 1:
putchar( 10);
for(m2 = 1; m2 & lt=30; m2++)
{
printf("%d\t ",m2);
if(m2 % 5 = = 0)printf(" \ n ");
}
Break;
Case 2:
for(m3 = 1; m3 & lt=28; m3++)
{
printf("%d\t ",m3);
if(m3 % 5 = = 0)printf(" \ n ");
}
putchar( 10);
Break;
}
}
}
LZ switch .. the case structure is wrong, and then turn to the book.
- Previous article:The countdown MV of Beijing Winter Olympics is coming. What is the mascot of Beijing Winter Olympics?
- Next article:The sea in solar terms
- Related articles
- What are the climatic characteristics of the summer solstice in 2022?
- What does middling mean? The doctrine of the mean explanation
- The circle of friends who dig bamboo shoots talk about the circle of friends who dig bamboo shoots.
- How to punish for cooking? What is criminal law?
- Sometimes the throttle won't open.
- What are the greetings of rain and solar terms?
- Which department of Nantong Lianya Pharmaceutical is the most comfortable?
- What is the cause of Audi a6l exhaust smoke? What is the smoke from Audi a6l exhaust?
- The first four and the last eight 336 EFI tachometers in Ou Man were unstable, and the fire stopped.
- The beautiful passages in Historical Records are immediate. The better, the more rewards.