|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>
) B3 y4 a X4 I3 ]# j% l/ F, N#include <BIOS.H>
$ L2 A0 I8 v/ m! Z& y" }#include <TIME.H>
* V9 ~* `+ s& t% K; U: w#include <CONIO.H>3 p* P7 D; H, k- ^. q
int main(void)/ y8 K/ i# G2 g( Y' E1 Y. b
{ long int bios_time;) p1 @+ j& c* c- W5 B
clrscr();
j' ]1 c; p: U+ H' t' J$ w& V cprintf("The number of clock ticks since midnight is:\r\n");
' t) E; o7 D* y4 j; `* ` cprintf("The number of seconds since midnight is:\r\n");
9 e5 T. L7 S7 ~; n% j$ q% b" l cprintf("The number of minutes since midnight is:\r\n");) W# F! V8 f; F( b0 D
cprintf("The number of hours since midnight is:\r\n");7 f( K0 ^! ^, T4 t
textcolor(9);( J& Z5 m. f! Q7 Q& k
cprintf("\r\nPress any key to quit:");
) \, r+ S# r8 x3 m textcolor(12);
! Y$ U$ R/ ~- c# c- X# x1 D: ] while(!kbhit()) {) z1 t" s5 `& C/ H0 ]* r2 J
bios_time = biostime(0, 0L);) n' _& ^5 F6 r$ t4 P0 H! b( k! p1 d
gotoxy(50, 1);6 L2 |" H3 I+ Z7 C2 v; s1 V2 w
cprintf("%lu", bios_time);' }0 K, B6 s3 h) C- e: m( z
gotoxy(50, 2);7 t v: ~( U7 y5 [, h/ Z- L/ w# G4 m j
cprintf("%.4f", bios_time / CLK_TCK);7 C5 @/ e/ [+ J# n
gotoxy(50, 3);* S( y$ X5 k- u
cprintf("%.4f", bios_time / CLK_TCK / 60);
' ~' H3 m: ]7 q4 `+ W# K% U gotoxy(50, 4);
/ H+ y1 ?; f' v4 o5 c" y cprintf("%.4f", bios_time / CLK_TCK / 3600);8 E3 v4 x& n9 l8 [; ?
}% c" b4 _3 W H1 `' f; ?5 E! h
return 0;1 Z5 k$ g0 b6 @( G5 g
} - L" X3 ]: y3 ], W y% T- @/ C
) t" {7 ~* ]" x2 Z( y' I
2 R3 \9 H& b) t3 i0 g- C; \$ L
0 `" r* k) p3 V$ o/ g8 d3 j8 ZTC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|