LinuxShell算術運算

使用let 命令
加法:
n=10
let n=n+1
echo $n #n=11html

乘法:
let m=n*10
echo $mide

除法:
let r=m/10
echo $rhtm


求餘數:
let r=m%7
echo $rblog


乘冪:it


let r=m**2class


echo $rdi

http://www.cppblog.com/fwxjj/archive/2009/09/04/95342.htmlview

相關文章
相關標籤/搜索