#include<stdio.h>
#include<conio.h>
#include<Windows.h>
int main(){
int s=0;
int min=0;
int hour=0;
while(!_kbhit()){
if(s%60==0 && s!=0){
s%=60;
min++;
if(min%60==0 && min!=0){
min%=60;
hour++;
}
}
printf("按任意键暂停 %02d:%02d:%02d",hour,min,s);
Sleep(1000);
s++;
system("cls");
}
printf("时间 %02d:%02d:%02d",hour,min,s);
getchar();
return 0;
}
c语言编写简单的计时器
最新推荐文章于 2024-09-07 01:21:34 发布