Добавлен скрипт НОК и моя часть main.sh

This commit is contained in:
24_NovikovDA
2026-02-27 11:58:29 +00:00
parent 15864bfa8f
commit 77e43f94cb
2 changed files with 28 additions and 0 deletions

17
script_LCM.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
a=$1
b=$2
temp_a=$a
temp_b=$b
while [ $temp_b -ne 0 ]; do
temp=$temp_b
temp_b=$((temp_a % temp_b))
temp_a=$temp
done
gcd=$temp_a
lcm=$(( (a * b) / gcd ))
echo $lcm