Files
21-Petruhov_Timofeev/script_GCD.sh
2026-02-28 04:35:32 +03:00

17 lines
205 B
Bash

#!/bin/bash
n=2
NOD=1
if [ $a -lt $b ]; then
min=$a
else
min=$b
fi
while [ $n -le $min ]; do
if [ $((a % n)) -eq 0 ] && [ $((b % n)) -eq 0 ]; then
NOD=$n
fi
n=$((n + 1))
done