diff --git a/script_GCD.sh b/script_GCD.sh index 022f242..81c3b68 100755 --- a/script_GCD.sh +++ b/script_GCD.sh @@ -1,6 +1,6 @@ #!/bin/bash - +# Function to find GCD using Euclidean algorithm gcd() { local a=$1 local b=$2 @@ -14,12 +14,12 @@ gcd() { echo $a } - +# Check arguments if [ $# -ne 2 ]; then echo "Usage: $0 " exit 1 fi - +# Call function and print result result=$(gcd $1 $2) echo "НОД($1, $2) = $result"