键盘输入:10
1 2 3 4 5 6 7 8 9 10
2 3 4 5 6 7 8 9
3 4 5 6 7 8
4 5 6 7
5 6
#!/bin/bash
read n
for((a=1;a<=n;a++))
do
c=n-a+1
for((b=a;b<=c;b++))
do
echo -n $b " "
done
echo
done
键盘输入:10
1 2 3 4 5 6 7 8 9 10
2 3 4 5 6 7 8 9
3 4 5 6 7 8
4 5 6 7
5 6
#!/bin/bash
read n
for((a=1;a<=n;a++))
do
c=n-a+1
for((b=a;b<=c;b++))
do
echo -n $b " "
done
echo
done