码迷,mamicode.com
首页 > 其他好文 > 详细

终端下显示颜色

时间:2017-10-29 12:40:40      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:ble   sci   ext   i++   void   sequence   oid   efault   cap   

//win平台和linux平台通用
#include<iostream>
#include<cstdio>
using namespace std;
void foo()
{
    for(int i=0;i<10;i++)
    {
    printf("\033[31mThis text is red \033[0mThis text has default color\n");
    cout<<"我是傻逼"<<endl;
    }
};
int main()
{
    foo();
    for(int j=0;j<5;j++)
        printf("\033[31mThis text is red \033[0mThis text has default color\n");
    cout<<"别担心我也是"<<endl;
    return 0;
}

来自这里

还有这里

终端下显示颜色

标签:ble   sci   ext   i++   void   sequence   oid   efault   cap   

原文地址:http://www.cnblogs.com/enyala/p/7749531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!