last lab
This commit is contained in:
10
labLinux/lab3/nums.sh
Executable file
10
labLinux/lab3/nums.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
read -p "Введите числа через пробел: " -a nums
|
||||
sum=0
|
||||
|
||||
for n in "${nums[@]}"; do
|
||||
((sum += n))
|
||||
done
|
||||
|
||||
echo "Сумма чисел: $sum"
|
||||
Reference in New Issue
Block a user