11 lines
205 B
Bash
11 lines
205 B
Bash
|
#!/bin/bash
|
|||
|
|
|||
|
# 编写一个Shell脚本,计算1到100之间所有3倍数的整数和svi
|
|||
|
|
|||
|
declare -i svi=0
|
|||
|
for (( i=1;i<=100;i++ )); do
|
|||
|
if (( i%3==0 )); then
|
|||
|
svi+=i
|
|||
|
fi
|
|||
|
done
|
|||
|
echo "svi="$svi
|