![在这里插入图片描述](https://img-blog.csdnimg.cn/20190314213424115.png?x-oss-
process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1lDX0ppYQ==,size_16,color_FFFFFF,t_70)
源代码:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int n;
char edge;
scanf("%d %c",&n,&edge);
int row = round(n/2.0);
int i=1;
for(;i<=row;i++){
if(i1||irow){
int j = 1;
for(;j<=n;j++)
putchar(edge);
}else{
putchar(edge);
int j = 1;
for(;j<=n-2;j++){
printf(" “);
}
putchar(edge);
}
printf(”\n");
}
return 0;
}