From 0cd515b4285d20536aff55a8192b358f590fa850 Mon Sep 17 00:00:00 2001 From: 24_TerTomasovMK <24_TerTomasovMK@iux.local> Date: Mon, 20 Apr 2026 10:22:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20script=5FLCM.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script_LCM.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/script_LCM.sh b/script_LCM.sh index 87e2fd1..bde85bc 100755 --- a/script_LCM.sh +++ b/script_LCM.sh @@ -14,20 +14,4 @@ lcm() { if [ $# -ne 2 ]; then echo "Usage: $0 "; exit 1 fi -echo "НОК($1, $2) = $(lcm $1 $2)"#!/bin/bash -gcd() { - local a=$1 b=$2 - while [ $b -ne 0 ]; do - local temp=$b; b=$((a % b)); a=$temp - done - echo $a -} -lcm() { - local a=$1 b=$2 - local g=$(gcd $a $b) - echo $(( (a * b) / g )) -} -if [ $# -ne 2 ]; then - echo "Usage: $0 "; exit 1 -fi echo "НОК($1, $2) = $(lcm $1 $2)"