3 Commits

3 changed files with 12 additions and 3 deletions

6
NOK.sh
View File

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

8
file.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
echo 'Введите число 1:'
echo 'Введите число 2:'
nod=$(./naibolshiy_obchiy_delitel.sh $1 $2)
nok=$(./NOK.sh $1 $2)
echo 'НОК:' $nok
echo 'НОД:' $nod

View File

@@ -2,6 +2,7 @@
a=$1
b=$2
while [ $b -ne 0 ]; do
x=$((a % b))
a=$b