最简单的链表
来源:互联网 发布:如何申请手机淘宝账号 编辑:程序博客网 时间:2024/04/28 08:06
#include<iostream>
#include<iomanip>
using namespace std;
struct Student
{
int num;
int score;
Student *q;
};
int main()
{
Student a, b, c,*p=&a;
a.num = 1; b.num = 2; c.num = 3;
a.score = 30; b.score = 60; c.score = 90;
a.q = &b;
b.q = &c;
c.q = NULL;
do
{
cout << p->num << " " << p->score << endl;
p = p->q;
} while (p != NULL);
cin >> a.num;
return 0;
}
#include<iomanip>
using namespace std;
struct Student
{
int num;
int score;
Student *q;
};
int main()
{
Student a, b, c,*p=&a;
a.num = 1; b.num = 2; c.num = 3;
a.score = 30; b.score = 60; c.score = 90;
a.q = &b;
b.q = &c;
c.q = NULL;
do
{
cout << p->num << " " << p->score << endl;
p = p->q;
} while (p != NULL);
cin >> a.num;
return 0;
}
0 0
- 最简单的链表
- 单向链表的反转最简单方法
- 单向链表的反转最简单方法
- C语言 最简单的链表插入
- 最典型的链表逆转 简单易懂
- ABAP最简单的串表查询
- 最简单的数据结构----线性表
- 最简单的数据结构:线性表(一)
- 最简单的留言板
- 最简单的makefile
- 最简单的多线程
- 最简单的时间
- 最简单的j2eeWEB
- 最简单的Javascript
- 最简单的JNI
- 最简单的ocx
- 最简单的饭
- 最简单的makefile
- 为什么不要在android或者ios上直连mysql或者sqlserver之类的数据库(跳大神)
- Java中的String
- 如何学习好Java
- [Unity3d]Player Settings导出设置
- Unity公告板的使用:
- 最简单的链表
- Python3.3 continuation line under-indented for visual indent 与 multiple spaces after ,
- 广播机制
- 去除图片的阴影部分,只显示图片:
- C#命令式任务并行开发
- C语言——数组、函数、预处理
- outlook登陆安全控制设置
- Android_adb shell am/pm使用
- tiny210(s5pv210)移植u-boot(基于 2014.4 版本)——SPL