#!/bin/bash
#kenthy#qingdaonews.com 2006-08-20
read -p "Input Max Lines:" MAX
i=1
N=$MAX
while [ $i -le $MAX ]
do
n=1
while [ $n -le $N ]
do
echo -en " "
let n++
done
let N--
j=1
while [ $j -le $i ]
do
A=$[i-1]
B=$[j-1]
if [ $j -eq $i ] || [ $j -eq 1 ] ; then
declare SUM_${i}_$j=1
else
declare AA=$[SUM_${A}_$j]
declare BB=$[SUM_${A}_$B]
declare SUM_${i}_$j=`expr $AA + $BB`
fi
echo -n $[SUM_${i}_$j]
echo -en " "
let j++
done
echo
let i++
done
阅读(992) | 评论(0) | 转发(0) |