more15.c
来自「C」· C语言 代码 · 共 50 行
C
50 行
#include <stdio.h>
#include <time.h>
#include <dos.h>
void main (void)
{
char buffer[256];
char key_pressed = 0;
long int counter = 1;
union REGS inregs, outregs;
time_t start_time, current_time, end_time;
while (fgets(buffer, sizeof(buffer), stdin))
{
fputs (buffer, stdout);
if ((++counter % 25) == 0)
{
time (&start_time);
end_time = start_time + 15;
do
{
key_pressed = 0;
time (¤t_time);
inregs.h.ah = 1;
int86 (0x16, &inregs, &outregs);
if ((outregs.x.flags & 64) == 0)
{
key_pressed = 1;
do {
inregs.h.ah = 0;
int86 (0x16, &inregs, &outregs);
inregs.h.ah = 1;
int86 (0x16, &inregs, &outregs);
} while (! (outregs.x.flags & 64));
}
}
while ((current_time != end_time) && (! key_pressed));
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?