Linux下从命令行下读入两个数字并比较大小
Linux下从命令行下读入两个数字并比较大小
#!/bin/bash
echo "Please input number a:"
read a
echo "Please input number b:"
read b
if [ "$a" -eq "$b" ]
then echo "$a equals $b"
elif [ "$a" -gt "$b" ]
then echo "$a is greater than $b"
else
echo "$a is less than $b"
fi
相关推荐
87201442 2020-10-15
拿什么来拯救自己 2020-06-21
laisean 2020-11-11
Julyth 2020-10-16
laisean 2020-09-27
flycappuccino 2020-09-27
liguojia 2020-09-27
MXstudying 2020-09-05
WasteLand 2020-09-15
<?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh
mathchao 2020-09-15
tvk 2020-07-30
Zaratustra 2020-07-29
zhaowj00 2020-07-26
Zaratustra 2020-06-26
ldcwang 2020-06-25
IsanaYashiro 2020-06-16
赵家小少爷 2020-06-14
大牛牛 2020-06-14