當前位置:編程學習大全網 - 電腦編程 - 求壹個C語言寫的倒計時程序,要求顯示從30秒到0秒

求壹個C語言寫的倒計時程序,要求顯示從30秒到0秒

#include <stdio.h>

#include <time.h>

main()

{

clock_t start,end;

int n;

printf("How many seconds do you want to count? ");

scanf("%d",&n);

getchar();

clrscr();

start=end=clock();

while((n-(int)(end-start)/19)>=0)

{

printf("the time is: %d",n-(int)(end-start)/19);

sleep(1);

end=clock();

clrscr();

}

}

  • 上一篇:寶元數控系統,雕刻機,斷點再啟的時候,壹刀紮下去,機器先走Z軸,然後走X,Y. ,應該怎麽設置先走,X,Y
  • 下一篇:數控車床加工鋼圈壁厚6毫米,長度10毫米,毛坯是圓管車好壹頭割下來,掉頭車平面平行度怎麽老是有10
  • copyright 2024編程學習大全網