• 个人简介

    #include <bits/stdc++.h>

    using namespace std;

    struct node{

    ** int data;**

    ** node ***next;


    };

    int main(){

    ** node ***p,*head,*r;

    ** head=new node;**

    ** head->next **=NULL;

    ** r=head;**

    ** **//添加多个节点;

    ** int x;**

    ** for(int i=1;i<=5;i++){**

    ** cin>>x;**

    **p**=**new** **node** **;**
    

    ** p->next=NULL;**

    ** p->data=x;**

    ** r->next=p;**

    ** r=p;**

    ** **}


    **//删除数据**
    

    ** **//p=head->next;

    ** **//p->next=p->next->next;


    **//添加数据**
    

    ** p=head->next->next;**

    ** node ***s=new node;

    ** s->data=8888;**

    ** s->next=p->next;**

    ** p->next=s;**


    **//循环输出**
    

    ** p=head;**

    ** while(p->next!=NULL){**

    ** cout<<p->next->data<<" ";**

    ** p=p->next;**


    **}**
    

    ** return 0;**

    }

  • 最近活动