仅供参考,只为个人理解,如有不同意见欢迎评论区讨论。
#include<stdlib.h>
#include<stdio.h>
int nb(int x,int s[x][x])
{
for(int w=0;w<x;w++)
for(int h=0;h<x;h++)
if(s[w][h]!=s[h][w])
return 0;
return 1;
}
int main()
{
int i,j;
scanf("%d %d",&i,&j);
int ss[i][j];
if(i>j||i<j)
{
printf("你输入的数据有误");
exit(1);
}
for(int w=0;w<i;w++)
for(int h=0;h<j;h++)
scanf("%d",&ss[w][h]);
int w=nb(i,ss);
if(w==1)
printf("You input number team is ""YEs""");
else
printf("You input number team is ""NO""");
return 0;
}