From 3307655dcb1662a32b85cfc7022e3fd72d43cb00 Mon Sep 17 00:00:00 2001 From: "1282855823@qq.com" <1282855823@qq.com> Date: Tue, 8 Jan 2019 17:09:14 +0800 Subject: [PATCH] third commit --- 年历月历.c | 178 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 年历月历.c diff --git a/年历月历.c b/年历月历.c new file mode 100644 index 0000000..5f6d26f --- /dev/null +++ b/年历月历.c @@ -0,0 +1,178 @@ +#include +#include +#include +#include<> + +// ÿÔÂÌìÊý +#include +int month_day(int year,int month) +{ + switch(month) + { + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: + return 31;break; + + case 4: + case 6: + case 9: + case 11: + return 30;break; + + case 2: + if((year%4==0)&&(year%100!=0)||(year%400==0)) + { + return 29; + break; + } + else + { + return 28; + break; + } + } +} + + +// ÄêÀú + +void year_calendar(int year) +{ + int month,days,weekday,sum_day; + int i,j; + + year; + printf("ÇëÊäÈëÒª²éѯµÄÄê·Ý£º"); + scanf("%d",&year); + for(i=1;i