Python 3.
a, b, c, d = map(int, input().split())
for x in range(1000 + 1):
if a * x ** 3 + b * x**2 + c * x + d == 0:
print(x)
Пример ввода:
1 2017 -36598 65120
Пример вывода:
2
16
Const n=15;
var a,s:array [1..100] of integer;
i,j:integer;
begin
for i:=1 to n do begin
a[i]:=random(15);
write(a[i],' ');
end;
j:=1;
writeln;
writeln('Полученный массив');
for i:=1 to n do begin
if (a[i] mod 2 = 0) and (a[i]>0) then begin
inc(j);
s[j]:=a[i];
write(s[j],' ');<span>
end;
end;</span>