Compare commits
3 Commits
Feature
...
feature_Sl
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bc79f47a3 | |||
| c201b4942e | |||
| 7f73789e3e |
14
NOK.sh
Executable file
14
NOK.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
a=$1
|
||||||
|
cp_a=$a
|
||||||
|
b=$2
|
||||||
|
cp_b=$b
|
||||||
|
while [ $b -ne 0 ]; do
|
||||||
|
temp=$b
|
||||||
|
b=$((a % b))
|
||||||
|
a=$temp
|
||||||
|
done
|
||||||
|
c=$((cp_a * cp_b))
|
||||||
|
d=$((c / a))
|
||||||
|
echo $d
|
||||||
8
file.sh
8
file.sh
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo 'Введите число 1:'
|
|
||||||
echo 'Введите число 2:'
|
|
||||||
nod=$(./naibolshiy_obchiy_delitel.sh $1 $2)
|
|
||||||
nok=$(./NOK.sh $1 $2)
|
|
||||||
echo 'НОК:' $nok
|
|
||||||
echo 'НОД:' $nod
|
|
||||||
10
naibolshiy_obchiy_delitel.sh
Executable file
10
naibolshiy_obchiy_delitel.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
a=$1
|
||||||
|
b=$2
|
||||||
|
while [ $b -ne 0 ]; do
|
||||||
|
x=$((a % b))
|
||||||
|
a=$b
|
||||||
|
b=$x
|
||||||
|
done
|
||||||
|
echo $a
|
||||||
Reference in New Issue
Block a user