|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>
0 h# Q# l% w* J5 Z! N5 m; \#include <BIOS.H>/ Z' ^1 E( z1 H% C! o m, Y9 X
#include <TIME.H>
& @, a2 B5 P3 u( Y. V#include <CONIO.H>3 m! w( K; J x4 N( S8 X9 x4 E* |7 g
int main(void)0 V: q8 k4 Q L8 T
{ long int bios_time;
1 C3 F3 q9 `0 u- @. U O+ a% V clrscr();
# m5 e* J8 \# ~ cprintf("The number of clock ticks since midnight is:\r\n");: r; W" W1 j6 I4 B+ h5 \7 N
cprintf("The number of seconds since midnight is:\r\n");
3 \( n/ h8 F; z3 B0 K- e' G cprintf("The number of minutes since midnight is:\r\n");
0 j5 q6 K- w, B7 V! t2 Y cprintf("The number of hours since midnight is:\r\n");
1 {: U! x8 i O+ Y6 l+ H textcolor(9);* r7 |! n1 v6 d2 \
cprintf("\r\nPress any key to quit:");( Q8 {5 J- }2 u {: w/ q
textcolor(12);
2 h4 p8 b/ \- U: u5 p: h& } while(!kbhit()) {- G% N8 D( F3 v# _4 S8 c
bios_time = biostime(0, 0L);& Y3 S) g/ j% j9 h; }
gotoxy(50, 1);
+ I0 {; s/ s n6 U cprintf("%lu", bios_time);" [6 S0 D/ x4 W% o# ]9 i
gotoxy(50, 2);' E- B3 w6 L3 L& ]
cprintf("%.4f", bios_time / CLK_TCK);
& J* J% _3 W& x) {" L! n gotoxy(50, 3);$ C% j6 w i9 D2 [: l
cprintf("%.4f", bios_time / CLK_TCK / 60);
8 s' {3 a4 b. e1 N, x5 B gotoxy(50, 4);7 J$ ]9 M4 J9 N: \
cprintf("%.4f", bios_time / CLK_TCK / 3600);8 L+ B: C) a4 ^8 t9 y: E
}9 ^0 t0 W0 f& d) A- p ?* d, ~
return 0;2 t# q# W( X0 n `1 a6 w
}
N1 q/ f1 M- Z7 `" j; I. e& G/ \- s. e* n. \+ G
8 N# B* B: |% C" B5 f; G
+ B; G' M8 g. i! D4 b2 Z7 I
TC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|