题解 | #打印等腰三角形#
打印等腰三角形
https://www.nowcoder.com/practice/1c55ca2b73a34e80bafd5978810dd8ea
#!/bin/bash # read n; # awk -v n=$n 'BEGIN{ # for(i = 1; i <= n; ++i){ # row[i] = ""; # for(j = 1; j <= n-i; ++j){ # row[i] = row[i] " "; # } # for(k = 1; k <= i; ++k){ # row[i] = row[i] "* "; # } # print row[i]; # } # }' read n; awk -v n=$n 'BEGIN{ for(i = 1; i <= n; ++i){ row[i] = ""; for(j = n-i; j >= 1; --j){ row[i] = row[i] " "; } for(k = 1; k <= i; ++k){ row[i] = row[i] "* "; } print row[i]; } }'#你觉得今年春招回暖了吗##23届找工作求助阵地##我的实习求职记录##零基础学习C++#