#includeint main(void){ int k, j, l, n, i; char ch[2]; scanf("%d %s",&n,ch); k = 22; while (2 * k * k > n + 1) k--; for (i = k; i >= 1;i--) { for (j = 1;j<=k-i; j++) printf(" "); for (j = 1;j<=2*i-1; j++) printf("%c",ch[0]); if(k!=1) printf("n"); } for (i = 2; i <= k; i++) { for (j = 1; j <= k - i; j++) printf(" "); for (j = 1; j <= 2*i-1; j++) printf("%c",ch[0]); if(i!=k) printf("n"); } l = n - (2 * k * k - 1); if (l>0&&n!=1) printf("n%d", l); if (n == 1) printf("n0"); return 0; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)