改了下,为什么不行了???
代码:[mw_shl_code=c,true]#include <stdio.h>
#include <windows.h>
void moshu()
{
printf("\n");
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
printf("把这句话颜色变成红色\n");
system("pause");
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN);
printf("把这句话颜色变成黄色\n");
system("pause");
}
int main()
{
char a;
printf("今天我要给大家变一个魔术,请看:\n");
system("pause");
printf("下面魔术即将开始……\n");
system("pause");
printf("下面,我将会把下面的字变颜色……\n");
printf("大家信不信(Y/N)?");
scanf("%c",&a);
if(a=='Y' || a=='y')
{
printf("好了,你到底看不看了?(Y/N)?");
scanf("%c",&a);
if(a=='Y' || a=='y')
{
moshu();
}
else
{ return; }
}
else
{
printf("好!你敢不信!(咬牙切齿中……)我现在就给你变!");
Sleep(3000);
moshu();
}
system("pause");
return 0;
}[/mw_shl_code] |