Program zadacha;
uses crt;
var a, b, w, k: integer;
x: real;
begin
clrscr;
write ('vvedite a, b, w, k: ');
readln (a, b, w, k);
if k=1 then x:=log2(w-a)
else if k=2 then x:=sqrt(sqr(w)+b*w+a)
else if k=3 then x:=sqrt(w+a)+sqrt(w+b)
else if k>3 then x:=-(a*w)/w
else writeln ('nevernye ishodnye dannye');
writeln ('x=', x:0:4);
readkey;
end.
Тест:
a=2, b=3, w=7, k=1
x=2.3219