题解 | #KiKi判断上三角矩阵#
KiKi判断上三角矩阵
http://www.nowcoder.com/practice/9a6786c28cdb45f9b991685f867b5d08
int main()
{
int arr[10][10] = { 0 };
int i = 0;
int j = 0;
int n = 0;
scanf("%d", &n);
int sum = 0;
for (i = 0;i < n;i++)
{
for (j = 0;j < n;j++)
{
scanf("%d", &arr[i][j]);
while (i > j)
{
sum += arr[i][j];
break;
}
}
}
if (sum==0)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
return 0;
}