⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 年月.cpp

📁 解压后 每个.cpp都有中文名很清楚。我是初学者
💻 CPP
字号:
#include<stdio.h>
void main()
{
    int year,month;
	printf("\nenter the year: ");
	scanf("%d",&year);
  rewrite:
	printf("\enter the month: ");
	scanf("%d",&month);
	if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
		printf("the year u entered is a leap year!\n");
	else 
		printf("the year is not a leap year\n"); 

	if (month>=1 && month<=3)
		printf("the month is the first one\n");
	else if (month>=4 && month<=6)
		printf("the second ji du\n");
	else if (month>=7 && month<=9)
		printf("the third one\n");
	else if (month>=10 && month<=12)
		printf("the fourth one\n");
	else 
	   {printf("there is no month like u entered!\n");
        goto rewrite; 
	}
	
	if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
	{
		if (month==2)
	    printf("there are 29 days in the second month.\n");
     else if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12 && month!=2)
	    printf("there are 31 days int this months.\n");
     else if (month==4 || month==6 || month==9 || month==11 && month!=2)
        printf("there are 30 days in this months.\n");
	}
	else if (year % 4 != 0 || year % 400 != 0)
	{
		if (month==2)
	    printf("there are 28 days in the second month.\n");
     else if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12 && month!=2)
	    printf("there are 31 days int this months.\n");
     else if (month==4 || month==6 || month==9 || month==11 && month!=2)
        printf("there are 30 days in this months.\n"); 
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -