题目
实现三个函数:
(1)Is_LeapYear();
判断是否是闰年,判断条件是
1. 能整除4,但不能整除100
2. 能整除400
(2)YearMonth_To_day()
判断输入的月份是多少天,在这里应该注意二月份的天数,闰年二月份和不是闰年二月份天数是不一样的,在这应该加入一个判断语句。
(3)YearMonthDay_To_Total()
判断你输入的年月日是一年中的第几天。
在这里你要注意1, 3,5, 7,8, 10,12月都是31天
4 6 9 11月是30 天
二月份天数就要判断了。
代码实现
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void Is_Leap_year();
void YearMonth_to_day();
void YearMonthDay_to_total();
int year,month ,day;
int main(){
printf("请输入一个年 月 日:\n");
scanf("%d %d %d", &year , &month ,&day);
Is_Leap_year();
YearMonth_to_day();
YearMonthDay_to_total();
system("pau