feat: добавлен скрипт НОД и интерактивный main

This commit is contained in:
Morozov
2026-02-28 08:32:06 +03:00
parent 49aeb710f3
commit ea75c93356
2 changed files with 30 additions and 0 deletions

17
script_NOD.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Использование: $0 число1 число2"
exit 1
fi
a=$1
b=$2
while [ "$b" -ne 0 ]; do
temp=$b
b=$((a % b))
a=$temp
done
echo "$a"