【C】#矩阵相等判定#
矩阵相等判定
https://www.nowcoder.com/practice/2f058b1e89ae43f7ab650c0fd0b71fa8
#include <stdio.h> int main() { int n, m, flag = 1; scanf("%d %d", &n, &m); int arr1[n][m], arr2[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { scanf("%d", &arr1[i][j]); } } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { scanf("%d", &arr2[i][j]); if (arr2[i][j] != arr1[i][j]) { flag = 0; } } } if (flag == 1) printf("Yes\n"); else printf("No\n"); return 0; }