current position:Home>It's a little difficult for you to find mistakes. All kinds of mistakes

It's a little difficult for you to find mistakes. All kinds of mistakes

2022-02-02 21:57:31 CSDN Q & A

img

img

img




Refer to the answer 1:

The subject is too complicated , Revised as follows , For reference :

#include <stdio.h>#define N 10int main(){    int a[N][N], n, i, j, T, flg;    scanf("%d", &T);    while (T--)    {        scanf("%d", &n);        if (n > 10) continue;        for (i = 0, flg = 1; i < n; i++) {            for (j = 0; j < n; j++){                scanf("%d", &a[i][j]);                if (a[i][j] != 0 && i > j)                    flg = 0;            }        }        if (flg)            printf("YES\n");        else            printf("NO\n");    }}//3//3//1 2 3//0 4 5//0 0 6//YES//2//1 0//- 8 2//NO//3//1 2 3//1 4 5//0 - 1 6//NO



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022157293869.html

Random recommended