From 62eb5a8abc551aea5504f16af04ba5b7befcdd26 Mon Sep 17 00:00:00 2001 From: Petruhov George Date: Sat, 28 Feb 2026 04:35:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0=20=D0=9D=D0=9E?= =?UTF-8?q?=D0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script_GCD.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 script_GCD.sh diff --git a/script_GCD.sh b/script_GCD.sh new file mode 100644 index 0000000..a544fdc --- /dev/null +++ b/script_GCD.sh @@ -0,0 +1,16 @@ +#!/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