编一个程实现模拟电子表(C语言)

来源:互联网 发布:侵权淘宝 编辑:程序博客网 时间:2024/05/01 05:47
=tmpTm)/*判断是否到一秒时间*/{tmpTm=tm;second ++;if(second>59){minute++;second=0;if(minute>59){minute=0;hour++;if(hour>23)hour=0;}}printTime();}if(kbhit())/*判断是否有按键按下*/{ch=getch();switch(ch){case 0x1b:/*ESC键按下则退出*/return;case 0x0D:/*ENTER键按下则进行时间设定*/printStr(1 "+ -Press Esc to quit- +");}void main(){char ch;time_t tm 4 "+ -Press Enter to set Time- +");printStr(1 3 "+ -My Clock- +");printTime();printStr(1 1 second);}/*显示初始屏幕*/void showScr(){clrscr();printStr(1 minute hour 2);printf("| %02d:%02d:%02d |" y);printf(str);}void printTime(){gotoxy(1 char *str){gotoxy(x int y second=0;void printStr(int x minute=0 ENTER键时间设定*/#include <stdio.h>#include <conio.h>#include <time.h>int hour=0 /*软件名称:模拟秒表作者:风火石编译器:Turbo C 2.0使用方法:ESC键退出 &second);showScr();break;}}}} &minute &hour "Input InitTime please:");scanf("%d:%d:%d" 5 tmpTm;int curX;showScr();time(&tm);tmpTm=tm;while(1){time(&tm);/*取得当前时间*/if(tm
原创粉丝点击