#include <stdio.h> #include <stdlib.h> #include <Windows.h> #include <time.h> void main() { int i = 0; char str[20]; char strl[40]; int lTime = 0; srand((int)time(0)); while (1) { i++; lTime++; sprintf_s(str, "color %x%x", rand() % 16, rand() % 16); system(str); printf("\n%s", str); sprintf_s(strl, "title 程序启动%d秒(Gabriel)", lTime); system(strl); Sleep(1000); if (20 == i) { system("cls"); } } }
原文:https://www.cnblogs.com/seraphgabriel/p/9346634.html