【十二题解】 | #蛇形矩阵#
蛇形矩阵
http://www.nowcoder.com/practice/649b210ef44446e3b1cd1be6fa4cab5e
#include<stdio.h>
int main(){
int number;
while(scanf("%d", &number) != EOF){
int all = (1+number)*number/2;
int bias = 1;
int vi = 0;
for(int x= number; x>0; x--){
for(int i=bias; i<=number; i++){
printf("%d ", (1+i)*i/2-vi);
}
bias++;
vi++;
printf("\n");
}
}
}