Bash脚本
#!/bin/bash
for ((i=1;i<=8;i++))
do
for ((j=1;j<=i;j++))
do
echo -e "#\c"
done
echo -e "\n\c"
done
Python脚本
#!/usr/local/python3/bin/python3
i=1
while i<=8:
print('#'*i)
i+=1
转载于:https://blog.51cto.com/coolsky/1340711