⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.h

📁 清华大学出版社出版的c++程序设计课本
💻 H
字号:
//Begin of file list.h	
class List;		//前向引用声明
class Point	//Point类的声明
{
public:		//外部接口
	Point(float xx=0, float yy=0) {X=xx;Y=yy;}
	void SetPoint(float xx,  float yy) {X=xx;Y=yy;}
	float GetX() {return X;}
	float GetY() {return Y;}
	friend class List;	//声明友元类
private:		//私有数据成员
	float X,Y;
};

class Node	//Node类的声明
{
public:		//外部接口
	friend class List;	//声明友元类
private:		//私有成员
	Node(float x=0, float y=0):p_node(x,y){next=0;}
	Point p_node;
	Node *next;
};

class List		//List类的声明
{
public:		//外部接口
	List(){list=0;}
	List(float x, float y) {list=new Node(x,y);}
	int Print();	//输出链表
	void Append(float x, float y);	//建立链表
	float Linefit();	//线性回归计算
	int GetLength();	//统计链表节点数
private:
	Node *end();	//指向链尾函数
	Node *list;
};
//End of file list.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -