Var N:Array[1..20] of integer; i,j,q,k,max:integer;begin Randomize;writeln('массив');for i:=1 to 20 do beginN[i]:= random(100)-50;write(N[i]:4);end;writeln;i:=0;writeln('Измененый массив');While j<20 do beginj:= j + 2; k := N[j-1];N[j-1]:=N[j]; N[j]:= k;end;foreach q in N do beginwrite(q :4);end;end. var N,M:Array[1..20] of integer; i,j,min,q,k,max:integer;begin Randomize;max:=-200; min:=200;writeln('1 массив');for i:=1 to 20 do beginN[i]:= random(100)-50;write(N[i]:4);if ((N[i]>0 )and(N[i] mod 2 = 0))then beginif max < N[i] then max := N[i];if min > N[i] then min := N[i];j:= j + 1;M[j]:=N[i];end;end;writeln;writeln('2 массив');foreach k in M do beginwrite(k:4);end;writeln;if (max = -200) or (min = 200) then write ('нет чётных положительных элементов')else beginwrite('max = ' ,max:4);write(' min = ' ,min:4);end;end.
a=input().split()
f=-1
for i in range(len(a)):
if int(a[i])>0 and int(a[i])%2==0:
if f==-1:
min1=int(a[i])
max1=int(a[i])
f=1
elif int(a[i])>max1:
max1=int(a[i])
elif int(a[i])<min1:
min1=int(a[i])
if f==-1:
print('not solution')
else:
print('max=',end='')
print(max1)
print('min=',end='')
print(min1)
задача 2.
a=input().split()
k=0
max1=float(a[0])
for i in range(len(a)):
if float(a[i])==max1:
k+=1
elif float(a[i])>max1:
k=1
max1=float(a[i])
print(k)
задача 3.
a=input().split()
min1=float(a[0])
min2=float(a[0])
min3=float(a[0])
for i in range(len(a)):
if float(a[i])<min1:
min3=min2
min2=min1
min1=float(a[i])
elif float(a[i])<min2:
min3=min2
min2=float(a[i])
elif float(a[i])<min3:
min3=float(a[i])
print(min1)
print(min2)
print(min3)
var N,M:Array[1..20] of integer; i,j,min,q,k,max:integer;begin Randomize;max:=-200; min:=200;writeln('1 массив');for i:=1 to 20 do beginN[i]:= random(100)-50;write(N[i]:4);if ((N[i]>0 )and(N[i] mod 2 = 0))then beginif max < N[i] then max := N[i];if min > N[i] then min := N[i];j:= j + 1;M[j]:=N[i];end;end;writeln;writeln('2 массив');foreach k in M do beginwrite(k:4);end;writeln;if (max = -200) or (min = 200) then write ('нет чётных положительных элементов')else beginwrite('max = ' ,max:4);write(' min = ' ,min:4);end;end.