单链表的增、删、改、减(C++) (二)
数据
int k;
cout<<"请输入你要插入的同学的序号:";
cin>>k;
Insert(head,k);
//输出链表
Print(head);
//修改链表
cout<<"请输入你要修改的同学的序号:";
cin>>k;
Alter(head,k);
//输出链表
Print(head);
//删除其中的一个项
cout<<"请输入你要删除的同学的序号:";
cin>>k;
head=Delete(head,k);
//输出链表
Print(head);
//销毁链表
Destory(head);
return 0;
}