shell腳本-while循環從1加到100

#!/bin/bash
i=1
s=0
while [ $i -le 100 ]
do
s=$(( $s+$i ))
i=$(( $i+1 ))
done
echo "The sum is: $s"
相關文章
相關標籤/搜索