文章
17
粉丝
0
获赞
5
访问
1.3k
#include<iostream>
using namespace std;
struct Node{
int data;
struct Node *next;
};
struct Node *create(int n){
struct Node *head=nullptr,*p=nullptr;
for(int i=0;i<n;i++){
struct Node *now=(Node *)malloc(sizeof(Node));
int num;
cin>>num;
now->data=num;
now->next=NULL;
if(head==nullptr){
head=now;
}
else{
p->next=now;
}
p=now;
}
return h...
登录后发布评论
暂无评论,来抢沙发