C语言编程题求解!在线等!!

2024-11-27 23:43:29
推荐回答(3个)
回答1:

#include
int main()
{ int n,i,j,yes=1,a[30][30];
scanf("%d",&n);
for(i=0; ifor(j=0; jscanf("%d",&a[i][j]);
for(i=0; ifor(j=i+1; jif(a[i][j]!=a[j][i])yes=0;
printf("%s\n",yes?"Yes":"No");
return 0;
}

回答2:

int main(int argc, char *argv[])
{
int i=0;
int a[3][3]={
{1,2,3},
{2,2,3},
{3,3,3}};

for(i=0;i<2;i++)
if(a[i][i+1]!=a[i+1][i])break;
if(i<2)
printf("No");
else
if(a[i-1][i]==a[i][i-1])
printf("Yes");
else
printf("No");

}

回答3:

一个一个套 for关于i,j的双重循环 arry[i][j]里面的i,j互换呗