LoveUnix » 编程开发 & Rational » 显示1-50中含3和3的倍数的数字
让LU留住您的每

一天 让LU博客留住您的每一天
2008-1-22 20:31 kevinru
显示1-50中含3和3的倍数的数字

脚本如下:

#!/bin/sh
i=0
end=50

while [ $i -lt $end ]
do
   let i=$i+1;
   if [  $i %3 == "0"  ||  $i %10 == "3" ]   then
          echo $i;
   fi

done

条件表达式该怎么写?

页: [1]


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.