백준 17608 c언어1 [C언어] 백준 17608번 막대기 [ 문제 ][ 입력 ][ 출력 ][ 작성한 코드 ]#include #define MAX 100000int stack[MAX];int top = -1;void push(int x){ top++; stack[top] = x;}int pop(){ if(top == -1) return -1; return stack[top--];}int main(){ int n,h,i; int cnt = 0; int max = 0; scanf("%d",&n); for(i = 0; i max) { cnt++; max = height; } } printf("%d",cnt); return 0;} .. 2025. 4. 12. 이전 1 다음