?? matrixsymmetry.cpp
字號:
//MatrixSymmetry.cpp 判斷矩陣對稱
#include <iostream> //輸入輸出流
#include "Matrix.h" //矩陣類及相關函數等的定義
using namespace std; //名字空間
void main() // 定義控制臺應用程序的入口點
{
const double dma[4][4] =
{
{ 1.0, 2.0, 3.0, 4.0 },
{ 5.0, 6.0, 7.0, 8.0 },
{ 9.0, 10.0, 11.0, 12.0 },
{ 13.0, 14.0, 15.0, 16.0 }
};
const int dmb[3][3] =
{
{ 3, -3, -2 },
{ -3, 8, 4 },
{ -2, 4, -3 }
};
const double dmc[2][3] =
{
{ 3.0, -3.0, -2.0 },
{ -2.0, 4.0, -3.0 }
};
const matrix<double> matA(&dma[0][0], 4, 4);
const matrix<int> matB(&dmb[0][0], 3, 3);
const matrix<double> matC(&dmc[0][0], 2, 3);
if(MatrixSymmetry(matA))
cout << "The matA is Symmetry." << endl;
else
cout << "The matA is not Symmetry." << endl;
if(MatrixSymmetry(matB))
cout << "The matB is Symmetry." << endl;
else
cout << "The matB is not Symmetry." << endl;
if(MatrixSymmetry(matC))
cout << "The matC is Symmetry." << endl;
else
cout << "The matC is not Symmetry." << endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -