c语言,怎么让字体变色,例如 #include<stdio.h> main() { printf(_百度...
发布网友
发布时间:2024-08-27 11:57
我来回答
共1个回答
热心网友
时间:2024-08-31 10:14
#include "stdio.h"
#include "Windows.h"
int main()
{
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
printf("这句话显示红色\n");
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_BLUE);
printf("这句话显示蓝色\n");
getchar();
return 0;
}
请采纳