C++
#include <iostream>#include <vector>int main () { int a, b, c; std::cin >> a >> b >> c; std::vector list {a, b, c}; bool is_it_correct = std::find_if(list.begin(), list.end(), [](auto el){ return el > 0; }) != list.end() && std::find_if(list.begin(), list.end(), [](auto el){ return el < 0; }) != list.end(); if (is_it_correct) std::cout << "YES" << std::endl; else std::cout << "NO" << std::endl;}
Const
n=20;
Var
ar:array[1..n] of integer;
max,min,i:integer;
begin
max:=integer.MinValue;
min:=integer.MaxValue;
writeln('Array:');
for i:=1 to n do
begin
ar[i]:=random(-20,20);
write(ar[i]:4);
if ar[i]<min then min:=ar[i];
if ar[i]>max then max:=ar[i];
end;
writeln;
writeln('Sum=',min+max);
end.
Пример работы программы:
Array:
20 5 -1 -13 -14 16 -10 19 -6 -12 6 -14 9 -11 12 -9 -11 -14 10 20
Sum=6