shell脚本至计算1到100之间的奇数和与偶数和 计算1到100之间和奇数和与偶数和 #!/bin/bash Evensum=0 ODDsum=0 for i in {1..100};do if [ $(( i%2 )) -eq 0 ];then let Evensum+=$i else let ODDsum+=$i fi done echo "Evensum is $Evensum" echo "ODDsum is $ODDsum" ~ 1. 2...
shell脚本计算1到100的奇数和偶数和 #!/bin/bashEvensum=0ODDsum=0for i in {1..100};do if [ $(( i%2 )) -eq 0 ];then let Evensum+=$i else let ODDsum+=$i fi doneecho "Evensum is $Evensum"echo "ODDsum is $O
Evensum=0 ODDsum=0 for i in {1..100};do if [ $(( i%2 )) -eq 0 ];then let Evensum+=$i else let ODDsum+=$i fi done echo "Evensum is $Evensum"echo "ODDsum is $ODDsum"~