题解 | #箭形图案#
箭形图案
https://www.nowcoder.com/practice/a6d1081e0c9a42f19e42ed6cd91556c1
#include <stdio.h> int main() { int n; while (scanf("%d",&n)!=EOF) { int i,j; for(i=1;i<=n+1;i++){ for(j=1;j<=(2*(n+1)-i*2);j++){ printf(" "); } for(j=0;j<i;j++){ printf("*"); } printf("\n"); } for(i=1;i<=n;i++){ for(j=1;j<=i*2;j++){ printf(" "); } for(j=0;j<=n-i;j++){ printf("*"); } printf("\n"); } } return 0; }