题解 | #矩阵相等判定#
矩阵相等判定
https://www.nowcoder.com/practice/2f058b1e89ae43f7ab650c0fd0b71fa8
#include <stdio.h> int main() { int n, m, q, w, e, t,p,k,l,count=0; scanf("%d %d", &n,&m); int a[n][m], b[n][m]; for (q = 0; q < n; q++) { for (w = 0; w <m; w++) { scanf("%d", &t); a[q][w] = t; } } for (q = 0; q < n; q++) { for (w = 0; w < m; w++) { scanf("%d", &p); b[q][w] = p; } } for(k=0;k<n;k++) { for(l=0;l<m;l++) { if (a[k][l]!=b[k][l]) { count=1; } } } if (count==1) printf("No\n"); else printf("Yes\n"); return 0; }#c语言学习#