|

楼主 |
发表于 2003-11-20 20:27:11
|
显示全部楼层
我已经写好了,程序也已经发给她了,呵呵。现在写出来,大家帮忙检查一下吧,呵呵:- #!/bin/bash
- func()
- {
- echo "That's all. Thank you!"
- echo "$m $n $p"
- echo "$1 $2 $3"
- }
- m="Today"
- n="is"
- p=`date`
- echo -n "Please input the bonus: "
- read bonus
- if [ -z "$bonus" ]; then
- echo "You dont input anything!"
- else
- if [ $bonus -le 100000 ]; then
- outcome=$((bonus/10))
- elif [ $bonus -le 200000 ]; then
- outcome=$((10000+(bonus-100000)*75/1000))
- elif [ $bonus -le 400000 ]; then
- outcome=$((10000+7500+(bonus-200000)*5/100))
- elif [ $bonus -le 600000 ]; then
- outcome=$((10000+7500+10000+(bonus-400000)*3/100))
- elif [ $bonus -le 1000000 ]; then
- outcome=$((10000+7500+10000+6000+(bonus-600000)*15/1000))
- else
- outcome=$((10000+7500+10000+6000+6000+(bonus-1000000)/100))
- fi
- echo "The outcome is: $outcome"
- fi
- func
复制代码 |
|