C language, clock (for multi-level loop)

Online compilers cannot implement this and can only be executed in software.

The software I use is: Visual Studio 2019 

#include<stdio.h>
#include<Windows.h>
#include<time.h>
int main() {
	for (int i = 0; i < 24; i++) {//控制小时
		for (int j = 0; j < 60; j++) {//控制分钟
			for (int k = 0; k < 60; k++) {//控制小时
				
				printf("%d:%d:%d\n", i, j, k);
				Sleep(1000);//休眠一秒继续执行程序
				system("cls");//清屏

			}
		}
	}
	
	return 0;
}

The effect is as follows:

 

 

Guess you like

Origin blog.csdn.net/m0_62247560/article/details/125008635