赞
踩
#!/bin/bash
for i in {1..100}
do
echo "$i"
done
#!/bin/bash
sum=0
for i in {1..100}
do
let sum=$sum+$i
done
echo $sum
#!/bin/bash
sum=0
for i in {2..100..2}
do
let sum=$sum+$i
done
echo $sum
#!/bin/bash
for i in {1..100}
do
if [ `echo "$i%3"|bc` -eq 0 ]
then
echo -n \ "$i"
fi
done
#!/bin/bash
fact=1
for i in {1..100}
do
fact=$(echo "$fact*$i"|bc)
done
echo $fact
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。