matrixwithtranspose.cpp

来自「这是数据结构、算法与应用-C++语言描述的代码」· C++ 代码 · 共 24 行

CPP
24
字号
// test matrix transpose

#include <iostream>
#include "matrixWithTranspose.h"

using namespace std;
int main(void)
{
   matrix<int> x(3,2), y, z;
   for (int i = 1; i <= 3; i++)
      for (int j = 1; j <= 2; j++)
         x(i,j) = 2*i + j;
   cout << "Initialized x(i,j) = 2*i + j" << endl;
   cout << "x is" << endl;;
   cout << x << endl;

    x.transpose(y);
   cout << "Assigned y = x.transpose" << endl;
   cout << "y is" << endl;
   cout << y << endl;

   return 0;
}

⌨️ 快捷键说明

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