我想在 C 中制作秒表(实时秒表),而不使用 Turbo C 中的内置函数“Timer”。我的代码如下:
 #include<stdio.h>
 #include<conio.h>
 #include<dos.h>
 int main()
 {
 int hh,mm,ss;
 hh=mm=ss=0;
 gotoxy(10,10);
 printf("\nSTOP - WATCH: ");
 gotoxy(20,18);
 printf("HH : MM : SS");
 _setcursortype(_NOCURSOR);
 for(;;ss++) //An infinite loop
 {
  if(ss==60)
  {
    mm++;
    ss=0;
  }
  if(mm==60)
  {
    hh++;
    mm=0;
  }
  gotoxy(20,20);
  delay(1000);
  printf("%02d : %02d : %02d",hh,mm,ss);
 }  
 return 0;
 }
现在我想通过按下键盘上的按钮退出这个程序(让我们说'Q')。