|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>
3 u# s1 t! ]7 G1 c" t#include <BIOS.H>' J+ ]+ a& `$ U
#include <TIME.H>
3 p' t2 q# C8 T" Y( e" @9 Q#include <CONIO.H>+ G R# B5 Y3 ~% W( F* F! G
int main(void)
8 I/ E& k0 r% d{ long int bios_time;
- C" c4 X5 y2 P3 {$ n9 e clrscr();: ^8 y7 q# v; C# I2 f! l% g9 y7 Y
cprintf("The number of clock ticks since midnight is:\r\n");
9 \$ l, k3 v7 E; s/ A) s+ O cprintf("The number of seconds since midnight is:\r\n");
6 w6 C2 E) `7 W# O, X# d cprintf("The number of minutes since midnight is:\r\n");) o: d3 Q- P3 x7 M2 c
cprintf("The number of hours since midnight is:\r\n");# g6 A0 b3 n, G9 P
textcolor(9);) m% g# ]5 t1 ~% J* Z
cprintf("\r\nPress any key to quit:");9 s% F" Q' s+ d3 z1 Y
textcolor(12);
' S+ l- D* B& ?2 R" d2 x; ]2 p5 } while(!kbhit()) {
: T: ~% W& j6 C7 w p; K bios_time = biostime(0, 0L);4 Q/ r- `) L+ v" f
gotoxy(50, 1);1 s: c. {/ S g6 p
cprintf("%lu", bios_time);
: @5 E; V" S5 v# B; m gotoxy(50, 2);
0 O. T% a6 Y5 k+ K/ { cprintf("%.4f", bios_time / CLK_TCK);
' b' o x9 C! c2 S& p/ u' B% c6 i" X gotoxy(50, 3);1 n! h" ^) `/ g$ S
cprintf("%.4f", bios_time / CLK_TCK / 60);3 O U$ D) S; q8 [: l
gotoxy(50, 4);
2 G5 L6 ?5 P4 y; P1 y0 ]2 { cprintf("%.4f", bios_time / CLK_TCK / 3600);% o/ k% [- u% {; W
}4 x0 z* v) Y0 s( |( O
return 0;
( A" {& X4 ~# j3 S" R5 U}
, x) h! b/ ^" X5 p5 x. f( P; H$ k" M9 M( j' m
. t, m/ k& ^. _# |+ A1 t* D
% @/ r- m5 Q! |5 R% F/ ]
TC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|