read a
n=1
echo "您输入的数字是:$a"
echo "它的因子包括:"
while [ a -gt n ];
do
if [ $((a%n)) -eq 0 ]; then
echo $n
fi
n=$((n+1))
done
echo $a
#!/bin/bash
echo -en "$1: \t1\t$1"
for ((i=2;i<$1;i++));
do
let j=$1%$i
if test $j -eq 0;
then
echo -en "\t$i"
fi
done
echo