#include <stdio.h> #include<malloc.h> typedef struct Node { int data; struct Node* Next; } Node, *ListNode; void insert(ListNode* L, int n) { //头插法 ListNode p; int i, e; (*L) = (ListNode)malloc(sizeof(Node)); //头结点 (*L)->Next = NULL; for (i = 0; i < n; i++) { scanf("%d", &e); p = (ListNode)malloc(sizeof(Node)); p->data = e; p->Next = (*L)->Next; (*L)->Next = p; } } int main() { int i, n, d; while (scanf("%d", &n) != EOF ) { ListNode L, P; insert(&L, n); scanf("%d", &d); for (i = 0; i < d; i++) L = L->Next; printf("%d\n", L->data); } return 0; }