首页 > 编程语言 > 详细

C++动态时间显示

时间:2018-09-22 23:44:47      阅读:70      评论:0      收藏:0      [点我收藏+]

标签:技术分享   local   out   inf   turn   str   mes   cal   lib   

#include <iostream>
#include<stdlib.h>
#include<windows.h>
#include<string>
using namespace std;
int main()
{
    string week = " ";
    while (1)
    {
        SYSTEMTIME systemTime;
        GetLocalTime(&systemTime);
        cout << "当前时间是:" << systemTime.wYear << "" << systemTime.wMonth << "" << systemTime.wDay << "";
        cout << systemTime.wHour << "" << systemTime.wMinute << "" << systemTime.wSecond << "";
        switch (systemTime.wDayOfWeek)
        {
        case 0:
            week = "";
            break;
        case 1:
            week = "";
            break;
        case 2:
            week = "";
            break;
        case 3:
            week = "";
            break;
        case 4:
            week = "";
            break;
        case 5:
            week = "";
            break;
        case 6:
            week = "";
            break;
        }
        cout << "   星期";
        cout << week << endl;
        Sleep(1000);
        system("cls");
    }
    return 0;

}

 

技术分享图片

 

C++动态时间显示

标签:技术分享   local   out   inf   turn   str   mes   cal   lib   

原文:https://www.cnblogs.com/ruiy/p/9691579.html

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号