Обновить nod.sh

This commit is contained in:
2026-02-28 14:24:01 +03:00
parent 52e1502b6a
commit 73f3f4f64c

11
nod.sh
View File

@@ -20,16 +20,5 @@ gcd() {
echo $a
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
if [ $# -ne 2 ]; then
exit 1
fi
if ! [[ "$1" =~ ^[0-9]+$ ]] || ! [[ "$2" =~ ^[0-9]+$ ]]; then
echo "Ошибка: Аргументы должны быть целыми положительными числами"
exit 1
fi
result=$(gcd $1 $2)
echo "НОД($1, $2) = $result"
fi