1125: 上三角矩阵的判断
import java.util.Scanner;
public class Main {
static Scanner cin = new Scanner(System.in);static int [][]a = new int[21][21];public static void main(String[] args) {
int n=cin.nextInt();for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)a[i][j]=cin.nextInt();int flag=0;for(int i=1;i<=n;i++)for(int j=1;j<i;j++)if(a[i][j]!=0){
flag=1;break;}if(flag==1) System.out.println("NO");else System.out.println("YES");}
}