/*
#include <stdio.h>
#include<string.h>
int stack[201];
int top=-1;
int pop()
{
return stack[top--];
}
int push(int c)
{
top++ ;
stack[top]=c;
}
int main()
{
char str[201];
int i,a,n,c,b,h,num=0;
gets(str);
for(i=0;str[i]!=NULL;i++)
{
if(str[i]=='+'||str[i]=='-'||str[i]=='*')
{
a=pop();
b=pop();
if(str[i]=='+')
{
n=a+b;
}
else if(str[i]=='-')
{
n=b-a;
}
else if(str[i]=='*')
{
n=a*b;
}
push(n);
}
else if('0'<=str[i]&&str[i]<='9')
{
num=num*10+(str[i]-'0');
if(str[i+1]==' ')
{
push(num);
num=0;
}
}
}
printf("%d",pop());
return 0;
}
/*
10 20 +
10
1 2 3 * + 4 5 - 6 * +
1
5 3 +
후위 표기법은 두 피연산자를 먼저 쓰고 그 뒤에 연산자
a +b (x)
a b +
숫자 ,push
+ - * , pop 두번 하고 연산 결과push
38
1 2 3 * + 4 5 - 6 * +
1
1 + 2 * 3
1 2 3 * +
*/
///Console Game
///콘솔 제어 1. 원하는 위치에 글자 출력하기
/// to do. 2. 콘솔 전부 지우기, 3. Sleep 기다리기
#include <stdio.h>
#include <windows.h>
void gotoxy(int y, int x)
{
COORD Pos;
Pos.X = x; Pos.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Pos);
}
int main()
{
//커서를 10,10으로 이동
gotoxy(10,10);
printf("hello");
gotoxy(20,20);
printf("jisung");
gotoxy(0,0);
printf("***********************");
gotoxy(23,20);
return 0;
}