万年历代码 c语言

如题所述

第1个回答  2019-08-11
你试一下下面这个代码吧
#include
#define
LMonth
31
#define
SMonth
30
#define
VMonth
28
typedef
enum
{
Sun,
Mon,
Jue,
Wed,
Thu,
Fri,
Sat
}
WEEK;
typedef
enum
{
January
=1,
February,
Match,
Apirl,
May,
June,
July,
August,
September,
October,
November,
December
}
MONTH;
void
printMonHead(void)
{
printf("
Sun
Mon
Jue
Wed
Thu
Fri
Sat\n");
}
void
printMonth(const
WEEK
firstDay,
int
length
)
{
WEEK
weekDay
=
firstDay
%7;
int
i;
printMonHead();
for
(i=0;
i
评论
0
0
加载更多