⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 more15.c

📁 不错书对C++/C程序员很有用的大家不要错过.
💻 C
字号:
#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 (&current_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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -