qfedu-linux-advanced-level/day1/d28.sh

11 lines
128 B
Bash
Raw Normal View History

2023-08-14 17:48:45 +08:00
#!/bin/bash
declare -i ret=1
declare -i n
read -p "整数: " n
until [ $n -eq 1 ]; do
ret=ret*n
n=n-1
done
echo "$ret"