|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>
3 A$ r* o# J- F- K/ u: m* H+ V#include <BIOS.H>
& h& L0 z6 O [& F) N- Y: E" P/ T#include <TIME.H>
7 t3 |% _7 j: o5 g. Q/ d#include <CONIO.H>7 O2 F Z& Z. ^) [6 `
int main(void)/ e7 Q; F% F" }: [6 g% w
{ long int bios_time;9 O" M3 i& Z( M! L4 y1 f
clrscr();7 G1 `8 g2 ^- ]9 N( Q
cprintf("The number of clock ticks since midnight is:\r\n");
& e" z7 `4 v. a8 E! H6 ] cprintf("The number of seconds since midnight is:\r\n");
8 V" {( R y% Q" n- O0 F) S9 Z cprintf("The number of minutes since midnight is:\r\n");
2 r1 q9 S2 i# F8 G T cprintf("The number of hours since midnight is:\r\n");
1 e; @' ^4 o' y% r textcolor(9);3 W$ F6 G( Y- Q4 F8 M9 {
cprintf("\r\nPress any key to quit:");' s3 Z: L6 J' `2 r- R" U
textcolor(12);
/ x: D; P7 l. R8 M) E7 v0 n while(!kbhit()) {; [( T C1 |% `
bios_time = biostime(0, 0L);/ i7 }$ J6 U3 f! C
gotoxy(50, 1);
7 E: R) S; M& \% L* m cprintf("%lu", bios_time);
" @* E+ ^9 x- c gotoxy(50, 2);
" b; N) ~' b0 V! Y# ~ cprintf("%.4f", bios_time / CLK_TCK);, o; a U0 _* h! s
gotoxy(50, 3);
~6 @" Z1 V9 y! x; j5 F cprintf("%.4f", bios_time / CLK_TCK / 60);
' M a9 A6 p* j. S7 c# g& Z! k gotoxy(50, 4);
2 z7 A& Q+ O% o0 b cprintf("%.4f", bios_time / CLK_TCK / 3600);
6 a: ?4 ^. w6 L }3 A+ Z8 i+ P& d8 V) S' K8 M) |
return 0;2 r$ l- ^; W9 I3 R1 H
} * H+ q2 s2 [7 p
* D. ?/ G6 A' Q" I
/ D5 _' v& I, v
3 ]5 f( x; d4 W- pTC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|