一维数组
#include <stdio.h> int main() { int n = 0,m = 0, arr1[50]={0}, arr2[50]={0}; scanf("%d %d",&n,&m); for(int i = 0;i<n*m;++i) scanf("%d",&arr1[i]); for(int i = 0;i<n*m;++i) scanf("%d",&arr2[i]); int x = 0; for(int i = 0;i<n*m;++i) if(arr1[i]!=arr2[i]) { x=1; break; } printf(x==1? "No\n": "Yes\n"); return 0; }