2017年2月11日
来源:互联网 发布:php 截取字符串 编辑:程序博客网 时间:2024/05/16 19:36
循环链表的构建:
#include
#include
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
void CreateList_L(LinkList &L,int &n)
{
char c;
bool fl=true;
L=(LinkList) malloc (sizeof(LNode));
L->next=NULL;
LinkList p;
while(fl)
{
if(scanf("%d",&c))
{
p=(LinkList) malloc (sizeof(LNode));
p->data=c;
p->next=L->next;L->next=p;
n++;
}
else{fl=false;}
}
}
void main()
{
LinkList L;
int n=0;
printf("请输入整型链表值,输入除整型字符外的字符退出:\n");
CreateList_L(L,n);
LinkList q;
q=L;
for(int i=n;i>0;--i)
{
q=q->next;
printf("%d\n",q->data);
}
}
#include
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
void CreateList_L(LinkList &L,int &n)
{
char c;
bool fl=true;
L=(LinkList) malloc (sizeof(LNode));
L->next=NULL;
LinkList p;
while(fl)
{
if(scanf("%d",&c))
{
p=(LinkList) malloc (sizeof(LNode));
p->data=c;
p->next=L->next;L->next=p;
n++;
}
else{fl=false;}
}
}
void main()
{
LinkList L;
int n=0;
printf("请输入整型链表值,输入除整型字符外的字符退出:\n");
CreateList_L(L,n);
LinkList q;
q=L;
for(int i=n;i>0;--i)
{
q=q->next;
printf("%d\n",q->data);
}
}
0 0
- #2017年2月11日
- 2017年2月11日
- 11月2日
- 11月2日
- 11月2日
- 11月2日
- 11月2日
- 2017年11月2日训练总结
- 2017年11月2日训练日记
- 2017年11月2日 第二十四次总结
- 2017年11月2日提高组T1 Sequence
- /*2017年1月11日*/日志
- 2017年8月11日 星期五
- 2017年9月11日 晴转多云
- 2017年10月11日笔记
- 2017年10月11日
- 2017年11月02日作业
- 2017年11月04日作业
- 过了一年,再来回顾一下去年到现在,这一年多,作为初级前端小白的坎坷成长历程
- C++ string类的实现
- PAT-B1031.查验身份证
- hibernate使用HibernateCallback 回调的方法查询SQL时could not execute query--作怪的别名
- THE DRUNK JAILER POJ - 1218
- 2017年2月11日
- 理解函数指针
- 使用 Apache Jmeter 进行 NTLM 和 Kerberos 认证
- LeetCode 386. Lexicographical Numbers
- 矩形运算
- GDOI2017模拟2.14
- 反射
- COM---注册表
- 数据库静默模式(quiesce)实验