printf 打印颜色
int main(void) { printf("\033[31;1m haha\n"); printf("\033[32;1m haha\n"); printf("\033[33;1m haha\n"); printf("\033[34;1m haha\n"); printf("\033[35;1m haha\n"); printf("\033[36;1m haha\n"); printf("\033[37;1m haha\n"); return 0; }
结果
int main(void) { printf("\033[31;1m haha\n"); printf("\033[32;1m haha\n"); printf("\033[33;1m haha\n"); printf("\033[34;1m haha\n"); printf("\033[35;1m haha\n"); printf("\033[36;1m haha\n"); printf("\033[37;1m haha\n"); return 0; }
结果