#include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> struct node{ int x; struct node *next; }; char quit; int main() { struct node *tail; struct node *temp; struct node *counter; counter=tail; do{ temp=(struct node *)malloc(sizeof(struct node)); scanf("%d",&temp->x); scanf("%c",&quit); temp->next=NULL; counter->next=temp; counter=temp; }while(quit!='q'); getchar(); return 0; }