在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
试题: https://www.jinshuju.net/f/EGQL3D 语言: Shell (Bash) 复制代码 代码如下: #!/bin/bash ## Author : TaxKiz export PATH='/bin:/sbin:/usr/bin:/usr/sbin' ## NUM='3 5 7' ## 检查输入的数字个数是否为 3 个 CT $NUM ## 个位数列表 ## 检查输入的数字是否为个位数 CK $NUM ## 判断是否有重复的数字 SN $NUM ## 大喊一声 A1=$1 T1=$(( $1 * $2 )) TA=$(( $1 * $2 * $3 )) for num in {1..100} echo "scale=2; $num/$TA" | bc | grep 00 > /dev/null 2>&1 echo "scale=2; $num/$T1" | bc | grep 00 > /dev/null 2>&1 echo "scale=2; $num/$T2" | bc | grep 00 > /dev/null 2>&1 echo "scale=2; $num/$T3" | bc | grep 00 > /dev/null 2>&1 echo "scale=2; $num/$A1" | bc | grep 00 > /dev/null 2>&1 echo "scale=2; $num/$A2" | bc | grep 00 > /dev/null 2>&1 echo "scale=2; $num/$A3" | bc | grep 00 > /dev/null 2>&1 echo $num done GO $NUM |
请发表评论