12 lines
245 B
Bash
12 lines
245 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# declare 是 Bash 内置命令,用于声明变量的属性,包括类型、作用域和初始值等。
|
||
|
declare -i total=0
|
||
|
|
||
|
for (( i=5;i<=100;i++ )); do
|
||
|
if (( i%5 == 0 )); then
|
||
|
total+=i
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
echo "$total"
|