Link Exchange
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
จงเขียนโปรแกรมแสดงเวลาโดยสามารถแสดงเวลาในรูปแบบhh:mm:ss และแสดงเลขหลักวินาทีเมื่อมีการคลิกปุ่มใดๆบนคีย์บอร์ดก็ให้หยุดการทำงานของโปรแกรม
/* @Author: Mr.Suppakit Thongdee @Website: www.sourcecode.in.th */ #include <stdio.h> #include <time.h> #include <conio.h> #include <windows.h> //using namespace std; int main(int argc, char *argv[]) { char ch; time_t rawtime; struct tm * ptm; while(!_kbhit()){ system("cls"); //clrscr(); time(&rawtime); ptm = gmtime(&rawtime); printf("Current time: %2d:%02d:%2d",(ptm->tm_hour+7)%24, ptm->tm_min, ptm->tm_sec); Sleep(1000); } return 0; }
Home - Article - Tutorial - Sourcecode - Dev Handbook - Search - WebBoard - Links - About Us