输入2个数(x,y)如果x等于y,则输出z=x+y,如果x大于y,则输出z=x-y,否则输出z=x+y
vi number2.sh
#!/bin/bash
#written by lizheng
#about panduan
echo "please enter two number"
read x
read y
if test $x -eq $y
then echo "z=$x - $y"
elif test $x -gt $y
then echo "z=$x -$y"
else echo "z=$x + $y"
fi
时间: 2024-11-05 17:33:48