Задан одномерный массив вещественных элементов, составить процедуру позволяющую увеличить в три раза все элементы, значение которых принадлежат отрезку от 1 до 3 уменьшить на 4 все элементы значение которых по модулю превышает 7. (ответ на питоне)
Program project1777; uses math, Classes ; var x,y,z:integer; begin writeln('vedite 1 chislo');readln(x); writeln('vedite 2 chislo');readln(y); writeln('vedite 3 chislo');readln(z); begin if ((x>y) and (x>z)) then writeln('samoe bolshoe chislo ',x) else if ((y>x) and (y>z)) then writeln('samoe bolshoe chislo ',y) else if ((z>x) and (z>y)) then writeln('samoe bolshoe chislo ',z); end; begin if ((x<y) and (x<z)) then writeln('samoe malenkoe chislo ',x) else if ((y<x) and (y<z)) then writeln('samoe malenkoe chislo ',y) else if ((z<x) and (z<y)) then writeln('samoe malenkoe chislo ',z); end; readln; end.
Язык Python 3.7
Думаю по коду должно быть все понятно , но если возникнут вопросы
постараюсь ответить
1)
x = int (input())
print(6*x*(x+2)-(x+4))
2)
x = int (input())
if x>0:
print((x**2)+(2*x))
else :
print(x-3)
3)
x=13
i=10 #Счетчик
while i<100: #Цикл будет выполнятся пока i меньше 100
print(x*i)
i=i+1 #Обновление счетчика
4)
x=0 #Создание счетчика
while x<21:
print(9*(x**2)+6*x)
x=x+2 #Обновление счетчика
5)
x1=int(input())
x2=int(input())
x3=int(input())
if x1==x2 and x2==x3:
print("Треугольник равносторонний")
else:
print("Треугольник не равносторонний")
6)
a=int(input()) # Ввод значения
for i in range (1,a+1): #Создание цикла , в котором перебираются
print(i**2) числа от 1 до a