📄 matrixtest4.cpp.html
字号:
<html>
<head>
<title>matrixtest4.cpp</title>
</head>
<body>
<pre> <font color="#990000">1 #include "matrix4.h"
2
<font color="#009999">3 using std::cout;
4 namespace mat = BigCPlusPlus_Matrix;</font>
5
6 int main()
7 {
8 <font color="#009999">mat::Matrix</font> m(3, 3);
9 m[0][0] = m[1][1] = m[2][2] = 1;
10 m[0][1] = m[1][2] = 2;
11 cout << 2 * m << "\n";
12 cout << m * m << "\n";
13 cout << 2 * m + m * m;
14 try
15 {
16 m[4][2] = 7; <font color="#000099">// Purposeful subscript error</font>
17 }
18 catch (<font color="#009999">mat::Matrix::IndexException&</font> e)
19 {
20 cout << "Caught exception: " << e.what() << "\n";
21 }
22 return 0;
23 }</font></pre>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -