天天看點

任意3個數,判斷最大數

#!/bin/bash

echo "please enter three number:"

read -p "the first number is :" n1

read -p "the second number is :" n2

read -p "the third number is :" n3

let MAX=$n1

if [ $n2 -ge $n1 ] 

then

MAX=$n2

fi

if [ $n3 -ge $MAX ]

MAX=$n3

本文轉自 15816815732 51CTO部落格,原文連結:http://blog.51cto.com/68686789/1692084