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