Compare commits
4 Commits
feature_1
...
ae88fcad92
| Author | SHA1 | Date | |
|---|---|---|---|
| ae88fcad92 | |||
| 2e71ac2a79 | |||
| 46deb29580 | |||
| c201b4942e |
8
file.sh
Executable file
8
file.sh
Executable 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
|
||||||
11
naibolshiy_obchiy_delitel.sh
Executable file
11
naibolshiy_obchiy_delitel.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/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