1 Commits

Author SHA1 Message Date
805e426a36 Поменял переменные 2026-02-27 17:10:21 +03:00
3 changed files with 3 additions and 20 deletions

6
NOK.sh
View File

@@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
a=$1 a=$1
clone_a=$a cp_a=$a
b=$2 b=$2
clone_b=$b cp_b=$b
while [ $b -ne 0 ]; do while [ $b -ne 0 ]; do
temp=$b temp=$b
b=$((a % b)) b=$((a % b))
a=$temp a=$temp
done done
c=$((clone_a * clone_b)) c=$((cp_a * cp_b))
d=$((c / a)) d=$((c / a))
echo $d echo $d

View File

@@ -1,6 +0,0 @@
#!/bin/bash
nod=$(./naibolshiy_obchiy_delitel.sh $1 $2)
nok=$(./NOK.sh $1 $2)
echo 'НОК:' $nok
echo 'НОД:' $nod

View File

@@ -1,11 +0,0 @@
#!/bin/bash
a=$1
b=$2
while [ $b -ne 0 ]; do
x=$((a % b))
a=$b
b=$x
done
echo $a