文章
11
粉丝
70
获赞
0
访问
7.0k
#include <cstdio>
using namespace std;
#include <string.h>
#include <iostream>
#include <stdlib.h>
typedef struct node {
int element;
struct node* next;
}node,*Linklist;
int main() {
//建立两个链表
//初始化
Linklist L1 = (node*)malloc(sizeof(node));
Linklist L2 = (node*)malloc(sizeof(node));
L1->next = NULL;
L2->next = NULL;
int n1, n2;
cin >> n1;
//头插法
for (int i = 0; i < n1; i++) {
int temp;
Linklist p = (node*)malloc(sizeof(node));
cin >> temp;
p->element = temp;
p->next = L1->next;
 ...
登录后发布评论
暂无评论,来抢沙发