|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>0 \ @) _& E( |; a4 n' C a; J5 S& @
#include <BIOS.H>
3 s: Y. }0 a! N9 q; y. Q+ K: J#include <TIME.H> i; x3 }' Y- R5 o# w7 |+ [
#include <CONIO.H>
/ o7 d! H" ?3 Z& Sint main(void)
) C$ J z; b1 w! [" V6 _' w{ long int bios_time;4 b8 y4 D1 A/ ^9 _$ |
clrscr();# a6 H9 s v* q# Z- n
cprintf("The number of clock ticks since midnight is:\r\n");% y/ ^; q) T) J4 t$ N7 o7 P
cprintf("The number of seconds since midnight is:\r\n");
* Y8 l& o h% N7 n- j/ `7 R cprintf("The number of minutes since midnight is:\r\n");
/ @# i" ~' ^+ A. q cprintf("The number of hours since midnight is:\r\n");
; K1 I* V0 L* z" s1 M0 e0 x textcolor(9);
6 t; [- t& r6 H) }1 M; P cprintf("\r\nPress any key to quit:");
6 ~+ K, @# r& w, W1 s textcolor(12);5 w2 ` |; c! D8 k9 v$ D& p
while(!kbhit()) {; p$ [) p% q1 p) w4 z/ p
bios_time = biostime(0, 0L);. }, }" g% Y+ }- `: ^+ q, Y
gotoxy(50, 1);7 X1 o9 u: q( L% I. I7 z
cprintf("%lu", bios_time);0 d$ }2 x: H5 \! C5 H2 d" w
gotoxy(50, 2);
5 j) @) S& J6 z cprintf("%.4f", bios_time / CLK_TCK);( F9 |2 E" B3 F( p5 D
gotoxy(50, 3);
% z- b& r, z) |2 z8 d7 W cprintf("%.4f", bios_time / CLK_TCK / 60);
* H: f$ K; A. f" P gotoxy(50, 4);
% L( U! }, S9 P0 z cprintf("%.4f", bios_time / CLK_TCK / 3600);
! J, ?% x% P4 C8 f! A. N5 ~ }
. C/ \; v) b+ M* i; k5 ?% d return 0;( x( o' U' d _! L5 p p
}
* X2 O3 M# \" H: i
3 P7 u6 z6 L- i
# s! ?. h5 U0 u+ s/ I6 U$ z8 J* j
3 z' ]; T8 O+ ZTC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|