clear
declare -a a
a=( [0]=$1 [1]=$2 [2]=$3 )
max=${a[0]}
min=${a[0]}
l=${#a[*]}
for ((i=0;i<$l;i++))
do
if [ $max -le ${a[i]} ];then
max=${a[i]}
else min=${a[i]}
fi
done
echo "Phan tu lon nhat la: $max"
echo "Phan tu nho nhat la: $min"
Klik untuk melihat kode: :) =( :s :D :-D ^:D ^o^ 7:( :Q :p T_T @@, :-a :W *fck* x@