bash/shell 编辑注意事项


image.png

#输出7的倍数
#!bin/bash
num=0 #注意num的 后面
while(($num<=500))
do
   if (($num%7==0)) #注意if后面需要加上空格,而且有两层括号
   then
      echo $num
   fi
    let "num++"
done

  

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/282564.html

(0)
上一篇 2022年8月28日
下一篇 2022年8月28日

相关推荐

发表回复

登录后才能评论