AcWing 754. 平方矩阵 II
1. 地址
https://www.acwing.com/problem/content/756/
2. 题解
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
//每个元素的值为:各个元素下标相减的绝对值+1
int main(){
int matrix[102][102];
int n;
while(true){
scanf("%d",&n);
if(n == 0){
break;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
printf("%d ",abs(i-j)+1);
}
printf("\n");
}
printf("\n");
}
return 0;
}
标签:754,int,矩阵,II,include,AcWing
From: https://www.cnblogs.com/gao79135/p/17373744.html