Compare commits

2 Commits

Author SHA1 Message Date
63865e527f bang 2026-02-28 14:40:45 +03:00
7b0200c541 On branch first
Your branch is up to date with 'origin/first'.
 Changes to be committed:
	new file:   script_GCD.sh
2026-02-27 19:02:36 +03:00
2 changed files with 13 additions and 11 deletions

11
main.sh
View File

@@ -1,11 +0,0 @@
#!/bin/bash
echo "Введите первое число:"
read a
echo "Введите второе число:"
read b
gcd=$(./script_GCD.sh $a $b)
echo "НОД = $gcd"

13
script_GCD.sh Executable file
View File

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