首页 > 其他 > 详细

任意3个数,判断最大数

时间:2015-09-07 01:53:56      阅读:252      评论:0      收藏:0      [点我收藏+]

#!/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 ]

then

MAX=$n3

fi

echo "the max number is $MAX"

本文出自 “IT屌丝” 博客,请务必保留此出处http://68686789.blog.51cto.com/10438688/1692084

任意3个数,判断最大数

原文:http://68686789.blog.51cto.com/10438688/1692084

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!