|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>0 z5 \9 {& l* _6 G: i0 A
#include <BIOS.H>- n( o! B# j7 n4 {
#include <TIME.H>
4 |( o6 r+ X$ h" v- i' t2 {, A0 D6 `#include <CONIO.H>
: O. D, d' Q, S1 i2 Z) tint main(void)
3 ?. n0 a: ~. V4 d9 n{ long int bios_time;* y4 Y% {3 F- s% x6 b2 x5 F" s8 x
clrscr();/ I' A4 v% W4 `( U
cprintf("The number of clock ticks since midnight is:\r\n");
8 ^, \" o: t# Z# l: Q cprintf("The number of seconds since midnight is:\r\n");/ I! q& S( T7 J
cprintf("The number of minutes since midnight is:\r\n");
9 ~" g7 P: U$ e3 ]9 v cprintf("The number of hours since midnight is:\r\n");3 V. N" W& ^+ k9 U. K; e+ B* }6 ?6 c
textcolor(9);3 H/ [; V: |0 g; }6 X0 x) V
cprintf("\r\nPress any key to quit:");9 Z/ b0 V# O2 Z8 h" `$ b$ Z; g9 j7 H3 Q5 ?
textcolor(12);5 s/ t; U' Z1 z6 M
while(!kbhit()) {
8 U( n/ _3 b3 L: e2 m bios_time = biostime(0, 0L);
8 J/ t* z1 J5 F6 u4 o2 E; L gotoxy(50, 1);
3 U+ G- ~' g: {+ d0 l, ^' d4 q cprintf("%lu", bios_time);- _! X7 r0 k7 U! i$ y( s. A
gotoxy(50, 2);
4 ?/ H! c. M+ ~' [' H8 K/ {; ]0 u cprintf("%.4f", bios_time / CLK_TCK);
! `, A% W1 z- X( q3 ^4 H3 p gotoxy(50, 3);
2 T: s1 {9 o$ E, E3 [0 d cprintf("%.4f", bios_time / CLK_TCK / 60);$ P) _1 i8 k% v9 l# O8 I
gotoxy(50, 4);1 \# {4 _% R+ A+ o
cprintf("%.4f", bios_time / CLK_TCK / 3600);
+ V0 k6 U& H) f& R }+ w: [; \- G6 w7 j. u4 s/ i& u2 n
return 0;7 |# U# Z( W! B; t& r( ^. l* |+ f
} G, Y& ~7 E, {$ e' t$ m' H
$ j# g p& ?- O( {1 h: H6 q" j3 g
! t7 P; K2 f1 T' K K
2 U2 Y8 Y& O2 i) mTC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|