|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>% |/ [) {8 b: @( o
#include <BIOS.H>% D0 O; y `4 a9 g. ]' ?; ?" m
#include <TIME.H>6 d5 v G8 [! V7 I- W5 I/ J: u+ p3 w
#include <CONIO.H>* |, x; ]% v: d- ?2 p( b/ Y& k/ d
int main(void) g' L5 ^9 z" v7 R
{ long int bios_time;# w' R7 i# A. q3 \( |# X
clrscr();
( B; B# D/ H. Q0 c7 a cprintf("The number of clock ticks since midnight is:\r\n");; a/ k C# P& |+ D5 Y8 K6 J- s) {
cprintf("The number of seconds since midnight is:\r\n");) ]6 U! H6 ~3 a! a: o _; ^& R) M
cprintf("The number of minutes since midnight is:\r\n");$ _/ J* c0 v1 C- i* Y
cprintf("The number of hours since midnight is:\r\n");
6 _! R" Q' G+ b5 G textcolor(9);
: C, b9 |0 S6 Q8 H* t5 Z& X cprintf("\r\nPress any key to quit:");( z% X! q7 r1 O$ ^
textcolor(12);
( y5 d( @3 [! Y% f while(!kbhit()) {
& O) N% ]0 Z6 E& Y bios_time = biostime(0, 0L);
3 ^" j) B1 {9 U# {( H: |) H gotoxy(50, 1);. F1 |9 c4 e) I- a0 B4 e, q! W! V: j
cprintf("%lu", bios_time);
& A1 Y" a& H6 K$ E7 J% s gotoxy(50, 2);0 f. ]1 l* y4 _% I, q
cprintf("%.4f", bios_time / CLK_TCK);3 [, B/ q+ E% `5 q; L3 L+ j
gotoxy(50, 3);; Y: \8 ~3 ~; W2 {0 V, D
cprintf("%.4f", bios_time / CLK_TCK / 60);1 y. \ g$ M5 Q# ^1 n. M9 |0 g
gotoxy(50, 4);
: `1 ~) ?5 d3 V1 D4 ] cprintf("%.4f", bios_time / CLK_TCK / 3600);; q; i# ?3 D R. `3 w
}+ u9 { \1 H5 Y0 v( K
return 0;. O- {& K. p0 n! L3 W& a
}
& ~1 g/ L+ o! B) [. I
d$ u/ E5 I. y' h; h: I0 Q+ r0 n5 i
! z, {; a( d# x' g0 ~, vTC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|