#include <stdio.h>#include <stdlib.h>struct node{int a;struct node *next;};//定义结构体类型;int main(){struct node *head,*p;int n,i;int x;while(~scanf("%d",&n)){head = (struct node*)malloc(sizeof(struct node));//要多组输入,每一组输入都要重新开辟一个头结点;head -> next ...