Обновить NOK.sh

This commit is contained in:
2026-02-28 10:46:48 +03:00
parent cd707ce644
commit 2ec3d6dd93

22
NOK.sh
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# script_LCM.sh
gcd() {
a=$1
b=$2
while [ $b -ne 0 ]; do
temp=$b
b=$((a % b))
a=$temp
done
echo $a
}
lcm() {
a=$1
b=$2
gcd_val=$(gcd $a $b)
echo $((a * b / gcd_val))
}
lcm $1 $2