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

11 lines
128 B
Bash

#!/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"