#include <stdio.h>
#include <windows.h>
#include <Windows.h>
void gotoXY(int x, int y)
{
COORD Pos;
Pos.X = x;
Pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
}
int main()
{
system("mode con:cols=80 lines=30");
int x,a,s,d;
gotoXY(20,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 2 );
printf("1+1=");
scanf("%d",&a);
if(a==2)
{
system("cls");
gotoXY(30,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 8 );
printf("정답!");
Sleep(1000);
system("cls");
gotoXY(30,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 5 );
printf("2+2*2=");
scanf("%d",&s);
if(s==6)
{
system("cls");
gotoXY(30,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 8 );
printf("저엉답!");
Sleep(1000);
system("cls");
gotoXY(29,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 5 );
printf("2+2*2*44143434321435/351525455*5435245*0=");
scanf("%d",&d);
if(d==0)
{
system("cls");
gotoXY(30,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 8 );
printf("답정!");
}
}
else
{
gotoXY(30,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 8 );
printf("ㅃ2");
}
}
else
{
gotoXY(30,9);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 8 );
printf("ㅃ2");
}
return 0;
}
/*#include <stdio.h>
#include <windows.h>
#include <Windows.h>
void gotoXY(int x, int y)
{
COORD Pos;
Pos.X = x;
Pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
}
int main()
{
system("mode con:cols=100 lines=80");
int x;
gotoXY(10,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 3 );
printf("다음수를 더하기,빼기,나누기,곱해보세요");
Sleep(4000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 3 );
printf("\n곱하기: * 나누기: /");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 3 );
printf("8");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 2 );
printf("+13567767767");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 8 );
printf("-47577587578579");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 11 );
printf("*34434234");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 2 );
printf("/33434543534");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 5 );
printf("*0");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 6 );
printf("*4543535345345");
Sleep(2000);
system("cls");
Sleep(2000);
gotoXY(30,10);
SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), 3 );
printf("*5646546");
Sleep(2000);
system("cls");
Sleep(2000);
return 0;
}*/