J정처LAB
정보처리기사 실기
편집복원

2025년 2회 정보처리기사 실기

복원 문항을 학습 가능한 표현으로 정리하고 ITPASSLAB이 답안 기준과 해설을 편집 검수했습니다. 자동 판정과 점수는 학습용 예상 결과입니다.

한 문제씩 풀기문제마다 바로 답과 해설을 확인합니다.
0/20답안 작성
프로그래밍 언어 활용난도 중상

18번 · 주관식 · 5점

다음 C 프로그램의 실행 결과를 쓰시오.

C좌우로 밀어 전체 코드 보기
#include <stdio.h>
#include <stdlib.h>

struct Node {
    char value;
    struct Node *next;
};

struct Node *make_list(const char *text) {
    struct Node *head = NULL;

    while (*text) {
        struct Node *node = malloc(sizeof(struct Node));
        node->value = *text++;
        node->next = head;
        head = node;
    }
    return head;
}

int main(void) {
    struct Node *current = make_list("BEST");

    while (current) {
        putchar(current->value);
        struct Node *old = current;
        current = current->next;
        free(old);
    }
    return 0;
}

답안을 입력하세요

학습기록 준비 중