• #include
    #include

    struct link{
    int i;
    struct link*next;
    };

    int main(){
    int j;
    struct link*edge;
    struct link*head;
    head=(struct link*)malloc(sizeof(struct link));
    head->next=0;
    do{
    printf(“Input number:”);
    scanf(“%d”,&head->i);
    fflush(stdin);
    }while(head->ii>100);

    edge=head;
    edge->next=(struct link*)malloc(sizeof(struct link));
    edge=edge->next;
    edge->next=0;

    for(int k=0;k<1;k++)
    {
    if(edge==0)
    {
    break;
    }
    }

    for(j=0;jnext>0)
    {
    printf(“%d”,edge->i);
    edge=edge->next;
    printf(“->”);
    }
    do
    {
    printf(“\nInput Number:”);
    scanf(“%d”,&edge->i);
    fflush(stdin);
    }while(edge->ii>100);

    edge->next=(struct link*)malloc(sizeof(struct link));
    edge=edge->next;
    edge->next=0;
    }

    getchar();
    return 0;
    }

  • Leave a Reply

    Your email address will not be published. Required fields are marked *