Files
lab1/script_GCD.sh
dashamaxet-s 38f05dee34 add scripts v1
2026-02-22 00:17:13 +03:00

21 lines
174 B
Bash
Executable File

#!/bin/bash
if [ $# -ne 2 ]; then
echo "error, pls whrite 2 arguments"
exit 1
fi
a=$1
b=$2
while [ $b -ne 0 ]; do
ostatok=$((a % b))
a=$b
b=$ostatok
done
echo $a