20251213
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int data;
struct node *link;
} Node;
int main() {
int N, i, value;
Node *head = NULL;
Node *tail = NULL;
scanf("%d", &N);
for (i = 0; i < N; i++) {
Node x = (Node)malloc(sizeof(Node));
scanf("%d", &value);
x->data = value;
x->link = NULL;
if (head == NULL) {
head = x;
tail = x;
} else {
tail->link = x;
tail = x;
}
}
return 0;
}
7회 조회

