當前位置:編程學習大全網 - 網站源碼 - c語言 倒計時時鐘程序

c語言 倒計時時鐘程序

如果妳有TC,可以試壹試。

VC 的 kbhit() 不能返回 鍵名。

23:59:59 -- 86400 秒

#include <stdio.h>

#include <windows.h>

#include <conio.h>

void main()

{

long int t;

int flag =0;

t = 86400;

printf("press S start, press E stop\n");

while(1)

{

if (kbhit() == 'S' || kbhit() == 's') flag =1;

if (kbhit() == 'E' || kbhit() == 'e') flag =0;

Sleep(1000);

if (flag == 1) t = t -1;

if (t <= 0) break;

printf("%d ",t);

}

  • 上一篇:熱門短視頻數據分析的工具有哪些?
  • 下一篇:如何乘地鐵逃生?安卓版本
  • copyright 2024編程學習大全網