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

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

공개된 출제 정보를 바탕으로 재구성한 학습 문항입니다. 자동 판정과 점수는 학습용 예상 결과입니다.

한 문제씩 풀기문제마다 바로 답과 해설을 확인합니다.
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;
}

답안을 입력하세요

학습기록 준비 중

알림

안 읽은 답변 0개

문의·문제 오류 답변

아직 도착한 답변이 없습니다.

문의와 문제 오류 신고의 답변을 여기에서 확인할 수 있어요.

문의하기