CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 其他小程序

文件名称:matrix

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-11-16
  • 文件大小:
    1.18kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

3、  矩阵(三)

编写C++程序完成以下功能:

(1)  用类来实现矩阵,定义一个矩阵的类,属性包括:

   矩阵大小,用 lines, rows(行、列来表示);

   存贮矩阵的数组指针,根据矩阵大小动态申请(new)。

(2)  矩阵类的方法包括:

   构造函数,参数是矩阵大小,需要动态申请存贮矩阵的数组;

   析构函数,需要释放矩阵的数组指针;

   拷贝构造函数,需要申请和复制数组;

   输入,可以从cin中输入矩阵元素;

   输出,将矩阵格式化输出到cout;

   矩阵相加的函数,实现两个矩阵相加的功能,结果保存在另一个矩阵类,但必须矩阵大小相同;

   矩阵相减的函数,实现两个矩阵相减的功能,结果保存在另一个矩阵类,但必须矩阵大小相同。

(3)  定义三个矩阵:A1、A2、A3;

(4)  初始化A1、A2;

(5)  计算并输出A3 = A1加A2,A3=A1减A2;

(6)  用new动态创建三个矩阵类的对象:pA1、pA1、pA3;

(7)  初始化pA1、pA2;

(8)  计算并输出pA3=pA1加pA2,pA3=pA1减pA2;

(9)  释放pA1、pA1、pA3。-3, matrix, (c)

Write a C++ program to perform the following functions:

(1) matrix class, define a matrix of class attributes include:

 matrix size, lines, rows (rows and columns to represent)

 storage matrix array pointer, dynamic application (new) according to the size of the matrix.

(2) matrix class method comprising:

 constructor parameter is the size of the matrix, dynamic application memory matrix array

 destructor release matrix array pointer

 copy constructor, and the need to apply for and copy an array

The  input from cin input matrix elements

 output, the the matrix formatted output to cout

Function  matrix sum, the sum of two matrices, and the results are stored in another matrix class, but must be the same as the size of the matrix

 matrix function subtraction, subtract two matrices, and save the results in another matrix class, but it must be the same as the size of the matrix.

(3) d
(系统自动生成,下载前可以参看下载内容)

下载文件列表

matrix.cpp

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com