c语言英文表,C语言钟表设计(国外英文资料).doc

C语言钟表设计(国外英文资料)

C语言钟表设计(国外英文资料)

/ * electronic clock source code * /

# include < graphics. H >

# include < stdio, h >

H # include < math.h >

# include < DOS. H >

# include < string. H >

# include < conio. H >

# define PI 3.1415926 / * defines constant * /

# define UP 0x4800 / * UP the arrow key: modify the time * /

# define DOWN 0x5000 / * DOWN the key: modify the time * /

# define ESC 0x11b / * ESC key: exit system * /

# define TAB 0xf09 / * TAB key: move the cursor * /

/ * function declaration * /

Int keyhandle (int, int); / * keystroke, and call the relevant functions to handle * /

Int timeupchange (int); / * to move the buttons * /

Int timedownchange (int); / * handle the lower button * /

Int digithour (double); / * convert the double hour number to int * /

Int digitmin (double); / * convert the double minutes to int * /

Int digitsec (double); / * convert the double seconds to int * /

Void digit clock (int, int, int); / * to display the clock or minutes or seconds in a specified location

Void drawcursor (int); / * draw a cursor * /

Void clearcursor (int); / * eliminate the previous cursor * /

Void clockhandle (); / * clock processing * /

Double h, m, s; / * global variables: hours, minutes, seconds

Double x, x1, x2, y, y1, y2; / * global variable: the value of the seat is * /

Struct time t [1]; / * defines an array of time structure types * /

The main ()

{

Int driver, mode = 0, I, j;

Driver = DETECT; / * automatic detection display device * /

The initgraph. / * initialize the graphical system * /

Errorcode = graphresult () / * will have a good prompt interface when the exception occurs when an exception occurs when the graph is initialized

An error occurs when the errorcode (= grOk) / * graph is initialized

{

Printf (" Graphics error: % s/n ", grapherrormsg (errorcode));

Printf (" Press any key to halt: ");

Getch ();

The exit (1); / * return with error code * /

}

,0,3 setlinestyle (0); / * set the current line width and type: set the four point wide line

Setbkcolor (0); / * set

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值