• C++动态时间显示


    #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;
    
    }

  • 相关阅读:
    5402.绝对差不超过限制的最长数组
    快乐数
    无重复字符的最长子串
    数组中数字出现的次数
    盛最多的水
    对角线遍历
    LeetCode第24场周赛
    CSS样式
    笔记
    开关电源设计
  • 原文地址:https://www.cnblogs.com/ruiy/p/9691579.html
Copyright © 2020-2023  润新知