示例
#include <stdio.h> #include <windows.h> int main(void) { for (int i = 0; i <= 100; i++) { //\r使光标回到行首 printf("load: %d%% \r", i); Sleep(200);//暂停200毫秒 } getchar(); return 0; }
运行测试