top of page

소스 코드 제출

공개·회원 52명

20250812

/*

#include <stdio.h>

int stack[200]={};

int top=-1;


void push(int a)

{

top++;

stack[top]=a;

}


int pop()

{

if(top>-1)

{

top--;

}

return stack[top+1];

}


int main()

{

char arr[201]={};

int a, b;

gets(arr);


for(int i=0;arr[i]!=NULL;i++)

{

if(arr[i]>='0' && arr[i]<='9')

{

int num=0;

while(arr[i]>='0' && arr[i]<='9')

{

num = num*10+(arr[i]-'0');

i++;

}

push(num);

}

if(arr[i]=='+' || arr[i]=='-' || arr[i]=='*')

{

b=pop();

a=pop();

if(arr[i]=='+') push(a+b);

else if(arr[i]=='-') push(a-b);

else if(arr[i]=='*') push(a*b);

}

}

printf("%d",pop());

return 0;

}

*/


//소들의 헤어스타일

#include <stdio.h>

int stack[80000]={};

int top=-1;


void push(int a)

{

top++;

stack[top]=a;

}


int pop()

{

if(top>-1)

{

top--;

}

return stack[top+1];

}


int main()

{

int hi[80000]={};

int n;

int sum=0;

scanf("%d",&n);

for(int i=0;i<n;i++)

{

scanf("%d",&hi[i]);

push(hi[0]);

if(stack[top]>hi[i])

{

}

}

return 0;

}

4회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page