//n是行数,ch代表所要输出的字符 printf("输入所要打印的行数n和字符ch\n"); scanf("%d%c",&n,&ch); for(i=1;i<=(n+1)/2;i++) { for(k=1;k<=(n+1)/2-i;k++) printf("");//打印出每行的空格 for(j=1;j<=2*i-1;j++) printf("%c",ch);//打印出所要打印的字符 prin...
include <stdio.h>#include <math.h>int main(void){int n,i,j,cnt;while(scanf("%d",&n)!=EOF){cnt=0;for(i=-n;i<n+1;++i){for(j=-n;j<n+1;++j){putchar(abs(j)<=n-abs(i)?'A'+cnt++:' ');}putchar('\n');}}return 0;} ...
int main(){ int i,j,n,t;while(scanf("%d",&n) != EOF){ t = 0;for(i = 1;i <= n + 1;i++){ for(j = 0;j <=2*n;j++)putchar(abs(j-n) 0;i--){ for(j = 0;j <=2*n;j++)putchar(abs(j-n)
char ch; //n是行数,ch代表所要输出的字符 printf("输入所要打印的行数n和字符ch\n"); scanf("%d %c",&n,&ch); for(i=1;i<=(n+1)/2;i++) { for(k=1;k<=(n+1)/2-i;k++) printf(" ");//打印出每行的空格 for(j=1;j<=2*i-1;j++) printf("%c",ch);//打印出所要打...