C语言日历程序实现.pdfVIP

  • 1
  • 0
  • 约4.84千字
  • 约 4页
  • 2026-09-29 发布于北京
  • 举报

/本程序在VisualStudio2010旗

舰版中测试通过/

includestdio.h

#includestdlib.h

#includetime.h

#includeconio.h

#

defineKEYUP72//宏定义键盘的键值(↑)

#defineKEYDOWN80//宏定义键盘的键值(↓)

#

defineKEYLEFT75//宏定义键盘的键值(←)

#defineKEYRIGHT77//宏定义键盘的键值(→)

//函数部分

const

int

是闰年(int

年);

const

int

获取月天数(int

年,

int

月);

const

int

年

天数(int

年);

void

打印日历(int

年,

int

月);

void

main(){

int

year,month;

int

action

= 0//获取本地当前的年份和月份

time_t

timep;

struct

tm

*p;

time(timep);

p

==

localtime(timep);

year

==

p‑tm_year;//获取本地当前的年

份

month

==

p‑tm_mon

+1;//获取本地当前的月份

while(1

文档评论(0)

1亿VIP精品文档

相关文档