createchainbelt.cpp
来自「一个用于展示数据结构中插入」· C++ 代码 · 共 27 行
CPP
27 行
#include"chainbelth.h"
void Createlist(linklist &l)
{
int i,number;
linklist p;
printf("Please input a data indicate the length of the chain belt which you want to create:\n");
printf("Please input the number of the datas:\n");
printf("number=");
scanf("%d",&number);
printf("please input the datas you want to create the chain belt:\n");
for(i=number;i>0;--i)
{
p=(linklist)malloc(sizeof(Lnode));
if(!p)
printf("Error! Not have enough EMS memory interspace!\n");
scanf("%d",&p->data);
p->next=l->next;
l->next=p;
}
printf("The chain belt is:\n");
printout(l);
printf("\n");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?