\033[ Param {;Param;…}m 或 \e[ Param {;Param;…}m
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#define NONE "\e[0m"
#define RED "\e[0;31m"
#define BLUE "\e[0;34m"
int main()
{
int index = 0;
char str[21];
memset(str,'\0',sizeof(str));
char tmp[5] = {'-','\\','|','/','\0'};
while(index <=20)
{
str[index] = '#';
if(index <=10)
printf(RED"%s[%d%%%c]\r"NONE,str,index*5,tmp[index%4]);
else
printf(BLUE"%s[%d%%%c]\r"NONE,str,index*5,tmp[index%4]);
fflush(stdout);
index++;
usleep(100000);
}
printf("\n");
return 0;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有