示例: 输入31 2 3181 2 3 4 5 6 7 84输出35#include <stdlib.h>#include <stdio.h>typedef struct ListNode{int val;struct ListNode* m_pNext;}ListNode;ListNode* BuyNote(int x){ListNode* ret = (ListNode*)malloc(sizeof(ListNode));ret->val = x;ret->m_pNext = NULL;return ret;}int main(){int n = 0;int tmp = 0;int k = 0;ListNode* head = NULL;ListNode* cur = NULL;int i = 2;while (i--){scanf("%d", &n);int m = n;while (m--){scanf("%d", &tmp);ListNode* ptmp = BuyNote(tmp);if (head == NULL){head = ptmp;cur = head;}else{cur->m_pNext = ptmp;cur = cur->m_pNext;}}scanf("%d", &k);n = n - k;cur = head;while (n--){cur = cur->m_pNext;}printf("%d \n", cur->val);while (head){cur = head;head = head->m_pNext;free(cur);}}return 0;}