16 lines
169 B
Bash
Executable File
16 lines
169 B
Bash
Executable File
#!/bin/bash
|
|
# script_GCD.sh
|
|
|
|
gcd() {
|
|
a=$1
|
|
b=$2
|
|
while [ $b -ne 0 ]; do
|
|
temp=$b
|
|
b=$((a % b))
|
|
a=$temp
|
|
done
|
|
echo $a
|
|
}
|
|
|
|
gcd $1 $2
|