您好,这样的:
#include
#include
void main()
{
int m = 0, n = 0;
int i = 0, j = 0, k = 0;
scanf("%d%d",&m,&n);
for (i = -m; i <= m; i++)
{
for(k = 0; k < m - abs(i) + 1; k++)
printf(" ");
for(j = 0; j < n; j++)
{
if ( i == 0)
printf("*");
else
printf("%d", m - abs(i) + 1);
}
printf("\n");
}
}