|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>4 q+ v3 K- }! S' A ?* z$ F. _$ b
#include <BIOS.H>. Y5 J; k1 a- @
#include <TIME.H>
8 O* B3 j) k- }( D8 o#include <CONIO.H>3 w$ t( z2 B* R5 t+ l3 _# l: i
int main(void)
: Z( {! j. y/ c) ]. h6 N{ long int bios_time;
! b' U0 f# H) ~! \5 t E& ]# } clrscr();5 G9 M# G- v. P0 w! J% E
cprintf("The number of clock ticks since midnight is:\r\n");
7 Q; X2 ?# `3 G- q8 I! s cprintf("The number of seconds since midnight is:\r\n");
- X9 X7 z! ^- O1 @: t: K; r cprintf("The number of minutes since midnight is:\r\n");& `# [% W( m! `. i4 z+ E9 B5 X
cprintf("The number of hours since midnight is:\r\n");- e/ J9 G5 y. K" w2 {
textcolor(9);
5 g& V `4 a1 r `; r cprintf("\r\nPress any key to quit:");
4 [+ u; c. ^2 V textcolor(12);) t& z9 z2 r+ u! a
while(!kbhit()) {
/ K% b* p9 Y! U) D bios_time = biostime(0, 0L);
4 {/ K8 f( @0 l gotoxy(50, 1);
: \, F/ r" |, T- O6 k cprintf("%lu", bios_time);
: E. i% ] x, v' _5 T" ?8 i gotoxy(50, 2);! z, v* j) _7 j h7 t
cprintf("%.4f", bios_time / CLK_TCK);; O$ H/ h4 b1 B0 H9 z" n
gotoxy(50, 3);
0 n m% a0 j( @, |3 u) Z; n* F' X8 R cprintf("%.4f", bios_time / CLK_TCK / 60);
( b8 w6 t3 q& M& Z! s( D7 I gotoxy(50, 4);" \- a+ ^5 J% o+ W u* C
cprintf("%.4f", bios_time / CLK_TCK / 3600);
9 s7 L0 Q8 Z: O- h' J4 S }# L% W! B3 g9 v8 P% P# y) b1 U
return 0;8 F& I, b. H5 A8 M$ v
} / w6 t) E1 I& [& K0 j
/ M+ F4 h) m& p4 Q
' K' f7 e* A0 B0 j, d
+ s1 f& n; G+ o& S. }( ~. o
TC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|