- Подробности
- Автор: Super User
- Категория: Паскаль
- Просмотров: 7869
Написать программу на языке Pascal для реализации разветвляющегося алгоритма

x, у – известные величины.
Решение
var x,y,z:real;
begin
writeln('');
write('Vvedite x=');
readln(x);
write('Vvedite y=');
readln(y);
if (x>=0) and (y>=0) then
z:=sqrt(x)
else
if (x<0) and (y<0) then
z:=x*y
else
if (x>=0) and (y<0) then
z:=sin(x+y)
else begin
writeln('Net takogo yslovija');
readln;
exit;
end;
writeln('z=',z:4:2);
readln;
end.

x, у – известные величины.
Решение
var x,y,z:real;
begin
writeln('');
write('Vvedite x=');
readln(x);
write('Vvedite y=');
readln(y);
if (x>=0) and (y>=0) then
z:=sqrt(x)
else
if (x<0) and (y<0) then
z:=x*y
else
if (x>=0) and (y<0) then
z:=sin(x+y)
else begin
writeln('Net takogo yslovija');
readln;
exit;
end;
writeln('z=',z:4:2);
readln;
end.