#include <stdio.h>(30951)#include <stdlib.h>typedef struct{int val;struct ListNode* next;}ListNode;int main() {int n,v,k;while (scanf("%d", &n) != EOF) {ListNode *p,*q,*r;ListNode* Head=(ListNode*)malloc(sizeof(ListNode));Head->next=NULL;r=Head;while(n--){ //创建单向链表ListNode* node=(ListNode*)malloc(sizeof(ListNode));scanf("%d",&v);node->val=v;r->next=node;r=r->next;}p=Head->next;q=Head->next;scanf("%d",&k);if(k<0 && k>n) return NULL;for(int i=0;i<k;i++){q=q->next;}while(q!=NULL){q=q->next;p=p->next;}printf("%d\n", p->val);}return 0;} 「求助大佬帮看看这道算法题吧!」输入一个单向链表,输出该链表中倒数第k个结点,链表的倒数第1个结点为链表的尾指针。 链表结点定义如下: struct ListNode{ int m_nKey;... https://www.nowcoder.com/practice/54404a78aec1435a81150f15f899417d