KakaoTalk_20190606_001802318.png
  • 246x0w
Welcome
Curriculum
Install&Go
Board
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
  • 카테고리
  • 전체 게시물
  • 내 게시물
이재민
2020년 4월 15일
수정: 2020년 4월 15일

200415

게시판: 소스 코드 제출

#include <stdio.h>


#include <string.h>


int n,i,top=0;


char s[1000000],stack[100000];


void push(char d)

{

if (top>strlen(s)){

}

else{

stack[top]=d;

top++;

}

}


void pop()

{

if (top<0){


}

else{

top--;

stack[top]=0;

}

}


void judge()

{

if (top==0){

printf("good");

}

else {

printf("bad");

}

}


int main()

{

scanf("%s",s);

for (i=0; i<strlen(s); i++){

if (s[i]=='('){

push(s[i]);

}

else if (s[i]==')'){

pop();

}

}

judge();

}


댓글 0개
0
댓글
댓글 0개
유사 게시물
  • 200415
  • 200415
  • 20220818
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호