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

📄 matrix.h

📁 这个一个有关矩阵运算的程序
💻 H
字号:
#include <iostream.h>
#include"stdio.h"
//////////////////////////////////////////////////////////////////////
//定义三元组结构
//////////////////////////////////////////////////////////////////////
struct Triple{	
	int row , col;	
	float value;
};
class Matrix;
//////////////////////////////////////////////////////////////////////
//矩阵节点类
//////////////////////////////////////////////////////////////////////
class MatrixNode{
public:
	Triple triple; 
	MatrixNode* link;
        MatrixNode (Triple  t);//构造函数
};
//////////////////////////////////////////////////////////////////////
//矩阵类
/////////////////////////////////////////////////////////////////////
class Matrix{
public:
	Matrix();//构造函数
        int rows,column;//矩阵行列值
	MatrixNode* headnode;//头节点
	MatrixNode* Current;//标志当前节点
        void Add(Triple triple);//向矩阵中添加元素
	void Print();//矩阵打印
	void Transpose();//矩阵转置
	~Matrix(){};//析构函数
};
///////////////////////////////////////////////////////////////////////
//读取255个字符
///////////////////////////////////////////////////////////////////////
void readstr(FILE *f,char *string)
{
	do
	{
		fgets(string, 255, f);
	} while ((string[0] == '/') || (string[0] == '\n'));
	return;
}

⌨️ 快捷键说明

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