简单题,简单来
#include <iostream> using namespace std; int arr[105][105]; void solve(int n) { for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) { if (arr[i][j] != arr[j][i]) { cout << "No!" << endl; return; } } } cout << "Yes!" << endl; } int main() { int n; while (cin >> n) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) cin >> arr[i][j]; } solve(n); } } // 64 位输出请用 printf("%lld")