91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

shell 簡單計算器

發布時間:2020-07-08 14:28:11 來源:網絡 閱讀:493 作者:肖武龍 欄目:編程語言

#!/bin/bash

function tool_menu()
{
    echo "****************************************************"
    echo "*                                                  *"
    echo "*              calculation  tools                  *"
    echo "*                                                  *"
    echo "****************************************************"
}
function menu_choice()
{
    echo "A: Add two num."
    echo "B: Minus two num."
    echo "C: Multiply two num."
    echo "D:Divide two num."
    echo "Q: Close this function."
    echo "Please input your chiose:"
}
function add_num()
{
    echo "please inut your first num:"
    read first_num
    echo "please inut your second num:"
    read second_num
    let add=$first_num+$second_num
    echo "$first_num+$second_num=$add"
    return 0
}
function minus_num()
{
    echo "please inut your first num:"
    read first_num
    echo "please inut your second num:"
    read second_num
    let minus=$first_num-$second_num
    echo "$first_num-$second_num=$minus"
    return 0
}
function multiply_num()
{
    echo "please inut your first num:"
    read first_num
    echo "please inut your second num:"
    read second_num
    let multiply=$first_num*$second_num
    echo "$first_num*$second_num=$multiply"
    return 0
}

function divide_num()
{
    echo "please inut your first num:"
    read first_num
    echo "please inut your second num:"
    read second_num
    let divide=$first_num/$second_num
    echo "$first_num/$second_num=$divide"
    return 0
}
function main()
{
    clear
    tool_menu
    while :
    do
        menu_choice
        read menu_choice
        case $menu_choice in
            A|a) add_num ;;
            B|b) minus_num ;;
            C|c) multiply_num ;;
            D|d) divide_num ;;
            Q|q) break;;
            *) echo "Input error,please try agin.";;
        esac
    done
}
main
exit 0


 模板
#!/bin/bash

function tool_menu()
{
    echo "****************************************************"
    echo "*                                                  *"
    echo "*              calculation  tools                  *"
    echo "*                                                  *"
    echo "****************************************************"
}
function menu_choice()
{
    echo "A: Add two num."
    echo "B: Minus two num."
    echo "C: Multiply two num."
    echo "D:Divide two num."
    echo "Q: Close this function."
    echo "Please input your chiose:"
}
function add_num()
{

    echo "add."
}
function minus_num()
{

    echo "minus."
}
function multiply_num()
{
    echo "multiply."

}

function divide_num()
{

    echo "divide."

}
function main()
{
    clear 模板

    tool_menu
    while :
    do
        menu_choice
        read menu_choice
        case $menu_choice in
            A|a) add_num ;;
            B|b) minus_num ;;
            C|c) multiply_num ;;
            D|d) divide_num ;;
            Q|q) break;;
            *) echo "Input error,please try agin.";;
        esac
    done
}
main
exit 0

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

昌黎县| 云和县| SHOW| 东光县| 冕宁县| 来凤县| 林州市| 云龙县| 长阳| 中卫市| 晴隆县| 鸡西市| 雷州市| 彰化市| 额尔古纳市| 万载县| 九寨沟县| 沈阳市| 慈溪市| 诏安县| 龙海市| 陈巴尔虎旗| 上高县| 霍山县| 湾仔区| 道孚县| 元阳县| 景德镇市| 北流市| 肇源县| 治多县| 马鞍山市| 鹿泉市| 峡江县| 咸阳市| 阿拉善右旗| 彭阳县| 勃利县| 宜城市| 策勒县| 孟村|