-->
当前位置:首页 > 题库

PROGRAMMING:Judging symmetric matrix

Luz5年前 (2021-05-10)题库389
The new matrix obtained by exchanging the rows and columns of a matrix is called transpose matrix.
Put the $$m times n $$matrix
$$A=\begin{bmatrix}
a_{ 11} & a_{ 12} & \cdot \cdot \cdot & a_{ 1n} \\
a_{ 21} & a_{ 22} & \cdot \cdot \cdot & a_{ 2n} \\
\cdot \cdot \cdot & \cdot \cdot \cdot & \cdot \cdot \cdot & \cdot \cdot \cdot \\
a_{ m1} & a_{ m2} & \cdot \cdot \cdot & a_{ mn}
\end{bmatrix}$$
The transpose matrix of $$a $, denoted as $$a ^ t $$,
Namely
$$A^T=\begin{bmatrix}
a_{ 11} & a_{ 21} & \cdot \cdot \cdot & a_{ m1} \\
a_{ 12} & a_{ 22} & \cdot \cdot \cdot & a_{ m2} \\
\cdot \cdot \cdot & \cdot \cdot \cdot & \cdot \cdot \cdot & \cdot \cdot \cdot \\
a_{ 1n} & a_{ 2n} & \cdot \cdot \cdot & a_{ mn}
\end{bmatrix}$$
According to the definition, $$a $$is the $$m times n $$matrix, then $$a ^ t $$is the $$n times M $$matrix. For example,
$$A=\begin{bmatrix}
1 & 0 & 2 \\
-2 & 1 & 3
\end{bmatrix}$$
,
$$A^T=\begin{bmatrix}
1 & -2 \\
0 & 1 \\
2 & 3
\end{bmatrix}$$.
The $$n times n $$matrix is called a square matrix of order $$n $,
If a square matrix of order $$n is equal to its transpose, that is, $$a ^ t = a $$, then the matrix $$a $$is called a symmetric matrix.
###Input format:
Give the value of N in the first line (1 < n < 100).
The element values of all rows of n-order matrix are given from the second row.
###Output format:
When the input n-order matrix is symmetric, output "yes", otherwise output "no".
###Input example:
```in
three
1 0 2
-2 1 3
4 3 2
```
###Output example:
```out
No
```
###Input example:
```in
three
1 -2 4
-2 1 3
4 3 2
```
###Output example:
```out
Yes
```







answer:If there is no answer, please comment