From c91f2fc57e2dd6a8b4ce2b83dd0a050d3fbcf2b9 Mon Sep 17 00:00:00 2001 From: daniladkin2007-wq Date: Fri, 27 Feb 2026 19:01:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=9D=D0=9E=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 100755 script_GCD.sh diff --git a/script_GCD.sh b/script_GCD.sh new file mode 100755 index 0000000..9935264 --- /dev/null +++ b/script_GCD.sh @@ -0,0 +1,16 @@ +#!/bin/bash +if [ $# -ne 2 ]; then + echo "Использование: $0 <число1> <число2>" + exit 1 +fi + +a=$1 +b=$2 + +while [ $b -ne 0 ]; do + remainder=$((a % b)) + a=$b + b=$remainder +done + +echo $a