Files
repo2/main.sh
2026-02-28 15:43:00 +03:00

25 lines
643 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "Введите первое число:"
read num1
if ! [[ $num1 =~ ^[0-9]+$ ]]; then
echo "Ошибка: введите неотрицательное целое число"
exit 1
fi
echo "Введите второе число:"
read num2
if ! [[ $num2 =~ ^[0-9]+$ ]]; then
echo "Ошибка: введите неотрицательное целое число"
exit 1
fi
echo "ВВЕДЕННЫЕ ЧИСЛА: $num1 И $num2"
echo "Результат вычисления НОД:"
./script_GCD.sh "$num1" "$num2"
echo "Результат вычисления НОК:"
./script_LCM.sh "$num1" "$num2"