//倒三角形
#include<stdio.h>
#include<math.h>
int main()
{
int i,j,n;
while(~scanf("%d",&n))
{
for(i=n;i>=1;i--)
{
for(j=1;j<=n-i;j++)
printf(" ");
for(j=1;j<=2*i-1;j++)
printf("*");
printf("
");
}
}
return 0;
}
//蛇形矩阵
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#define MAX 10
int a[MAX][MAX];
int main()
{
int n;
while(~scanf("%d",&n))
{
int x=0,y=n-1,sum=1;
memset(a,0,sizeof(a));
sum=a[x][y]=1;
while(sum<n*n)
{
while(x+1<n&&!a[x+1][y]) a[++x][y]=++sum;
while(y-1>=0&&!a[x][y-1]) a[x][--y]=++sum;
while(x-1>=0&&!a[x-1][y]) a[--x][y]=++sum;
while(y+1<n&&! a[x][y+1]) a[x][++y]=++sum;
}
for(x=0;x<n;x++)
{
for(y=0;y<n;y++)
printf("%3d",a[x][y]);
printf("
");
}
}
return 0;
}