숙제코드
#include<stdio.h>
#include <windows.h>
void gotoxy(int x, int y)
{
COORD Pos = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
}
int main()
{
char n;
printf ("안아줘요\n");
Sleep(1000);
printf ("a:안아준다 b:자리를 떠난다\n");
gotoxy(10, 2);
scanf ("%c", &n);
system("cls");
if (n=='a'){
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 14 );
printf ("안아줬어요");
SetConsoleTitle( "HAPPY" );
}
else if (n=='b'){
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 3 );
printf ("너무해요..");
SetConsoleTitle( "SAD..." );
}
else {
printf ("???");
}
return 0;
}