|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>
7 ^+ f% R( B6 }6 d#include <BIOS.H>
' l L( Q! ~% q4 ^5 B#include <TIME.H>
K% f1 O! { o#include <CONIO.H>
+ g$ r8 n* y9 Qint main(void)$ A5 b* ~5 ^* U8 w
{ long int bios_time;6 @+ C f+ F1 t/ p; K( ~# Y
clrscr();0 O# n8 J% D7 A/ W$ ?* i
cprintf("The number of clock ticks since midnight is:\r\n");# U( }6 L# E! ]" z( J, X- D
cprintf("The number of seconds since midnight is:\r\n");
- {- V* y, B" a" O% I+ r cprintf("The number of minutes since midnight is:\r\n");
; j" @& Y4 y7 x: w3 N2 l2 u5 l7 w' c& O cprintf("The number of hours since midnight is:\r\n");
6 `3 C2 I/ \* @) _" E! _ textcolor(9);
; S, \# D2 w; `! g# F cprintf("\r\nPress any key to quit:");+ C) q' B- z1 Z& E( S
textcolor(12);' D" t1 e4 N, `& Y [4 w3 K& @
while(!kbhit()) {8 F3 K" i3 {" z
bios_time = biostime(0, 0L);9 U7 V1 O! t' x6 N- F' i/ U' Z1 G
gotoxy(50, 1);
9 O. V7 {4 S3 e cprintf("%lu", bios_time);8 z) \# _7 |4 R7 `
gotoxy(50, 2);
( X+ H$ v/ {, s7 N9 \2 M cprintf("%.4f", bios_time / CLK_TCK);& v6 _* j# S, ^% a9 H3 V* Y
gotoxy(50, 3);
6 [% @# q1 x4 Q8 o& k( r' n6 K: E cprintf("%.4f", bios_time / CLK_TCK / 60);
1 F: T- G; Q: t& a$ f5 y gotoxy(50, 4);
& ~( M( l; A7 d; F' w! R cprintf("%.4f", bios_time / CLK_TCK / 3600);
; |; b/ t( [" n, W% @& F }
0 z, R" Q+ b. D return 0;% L; \8 X/ x& W* Y* v2 i) g/ {
}
9 o$ k+ w7 g; e% f6 z
$ |' a* B0 X# C" D3 q d" f
3 G; D+ l3 v% d. T7 p* X+ V
+ U4 ~2 O8 [) L: ?TC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|