|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>
) h$ p$ X+ W6 u, C0 s#include <BIOS.H>1 m$ n* d j1 u6 x( z+ r2 h
#include <TIME.H>, a- U# r0 ~: i4 H
#include <CONIO.H>, p/ P' c( d0 |6 e
int main(void)5 v5 s$ @* w6 B) G$ ^0 b
{ long int bios_time;
8 l' H S3 O4 i6 o- ~( y* B clrscr();
; ^; j! P4 \8 r( G, v# o! S cprintf("The number of clock ticks since midnight is:\r\n");/ D! b6 u |( l0 h
cprintf("The number of seconds since midnight is:\r\n");4 @7 L ~& d& `& a& _" X- S' t
cprintf("The number of minutes since midnight is:\r\n");
4 x2 V' o+ A! V) N! f0 E I; R cprintf("The number of hours since midnight is:\r\n");; ^8 d+ ~* I& W5 a
textcolor(9);7 W( z( B" G2 \
cprintf("\r\nPress any key to quit:");
& _4 h, j: S: x) M( \7 T textcolor(12);8 ]% x/ V/ G3 }# Q4 H. ]
while(!kbhit()) {( s" l( B# J+ L; p2 N
bios_time = biostime(0, 0L);4 p1 g& S5 [& N; b
gotoxy(50, 1);
3 S$ p/ [# R9 F2 A0 `, u9 r; n cprintf("%lu", bios_time);
. T& X2 \$ V! P2 [0 O: s gotoxy(50, 2);4 u5 S' ~! j& M1 D3 l
cprintf("%.4f", bios_time / CLK_TCK);: y) q) r0 w4 |& j- R4 l
gotoxy(50, 3);1 ~- A2 Q+ C! D) r1 w
cprintf("%.4f", bios_time / CLK_TCK / 60);' s/ C v3 n( `5 L
gotoxy(50, 4);
0 U& ?2 y3 {) ]4 y$ Z0 d* O) T( ~5 g cprintf("%.4f", bios_time / CLK_TCK / 3600);4 u; o" P$ `: ~
}
& G5 V# }$ a, v9 I8 T3 i return 0;
; N; \' s4 s% V5 H3 m/ q, P} 4 w- ~' \' X7 P3 b( \
z6 p3 x! B7 @" B& J
! K# V5 f, D% d2 }- s; d: ?3 V, i% d+ `/ ^# g. R0 W4 i
TC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|