main()
{int i,j;
char diamond[10][10]={{' ',' ',' ','*'},{' ',' ','*','*','*'},{' ','*','*','*','*','*'},{'*','*','*','*','*','*','*'},{' ','*','*','*','*','*'},{' ',' ','*','*','*'},{' ',' ',' ','*'}};
for(i=0;i<10;i++)
{for(j=0;j<10;j++)
printf("%c",diamond[i][j]);
printf("\n");}}
这个更简单啊!不过效率就不知道了