C定时在控制台输出时分秒

一、概述

  案例:定时在控制台输出时分秒

二、示例代码

  

//定时输出时分秒

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <Windows.h>

using namespace std;



int main(int argc, char const *argv[])
{
	int i,j,k;
	//小时
	for(i=0;i<24;i++){
		//分钟
		for(j=0;j<60;j++){
			//秒
			for(k=0;k<60;k++){
				cout << i<<":"<<j<<":"<<k<<endl;
				Sleep(1000);
			}
		}
		
	}
	return 0;
}

  

原文地址:https://www.cnblogs.com/tony-yang-flutter/p/15386053.html