|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>' ?6 a' v( S |# q: g
#include <BIOS.H>' H- ]6 g7 y% b3 R, f
#include <TIME.H>
3 ]6 }9 R" O, V5 ^* A9 L#include <CONIO.H>
, p( [5 Z% A: @ Y. a+ y- bint main(void). U4 T7 b9 L% K- g3 L0 R
{ long int bios_time;
: d b$ l( T% i3 k7 Q" r6 e clrscr();6 E! l+ n) u1 Q. |8 F
cprintf("The number of clock ticks since midnight is:\r\n");
8 g: F# I. ?% ~* K, k cprintf("The number of seconds since midnight is:\r\n");- \+ C1 o& c# r( w
cprintf("The number of minutes since midnight is:\r\n");' C4 Q1 z$ @* N
cprintf("The number of hours since midnight is:\r\n");3 e% ?' A" b- ^* E+ I+ w! A6 N) S
textcolor(9);8 o6 B/ U3 L( v
cprintf("\r\nPress any key to quit:");- ~6 a* [! s1 a. z$ r
textcolor(12);) c5 e( S/ [8 O7 k5 y# X; N d
while(!kbhit()) {
y* C( p; G: _, D/ x bios_time = biostime(0, 0L);4 J4 O' q; T. f- C7 {6 l0 o
gotoxy(50, 1);
* F6 f; m2 x7 i. M. k3 Z1 ] cprintf("%lu", bios_time);& B9 Z! W3 A* v) V9 {( R2 O5 L
gotoxy(50, 2);
6 ]( d# ~; @5 h; x( J) H6 J; O cprintf("%.4f", bios_time / CLK_TCK);. Q O( F3 i& n
gotoxy(50, 3);( w6 Y9 x8 y+ b% X' o& S& I) q" H
cprintf("%.4f", bios_time / CLK_TCK / 60);$ n: t% B0 `2 {1 N6 b9 L
gotoxy(50, 4);
g- P ?0 ?( A7 f) i% \( X0 p cprintf("%.4f", bios_time / CLK_TCK / 3600);- w3 d' h+ n% G: P9 O' i' t6 ^* q* n
}3 F- h( W9 E/ i; y4 Z. {, K" U+ ?
return 0;
% h: j4 P1 o' R0 u8 l: K4 v, w} , g9 E: m: l+ W) c
/ Z+ H. q& r5 O) U" d
8 Z* C" D+ U* a. k/ B& h# Z$ R1 I# ]
# L/ Y. h+ p! {6 V0 WTC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|