改变文字颜色
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("color 5"); //将文字颜色改为紫色
printf("ni hao\n");
system("pause");
return 0;
}
改变背景颜色
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("color f5"); //将背景颜色改为白色,文字颜色改为紫色
printf("ni hao\n");
system("pause");
return 0;
}