Skip to content

Instantly share code, notes, and snippets.

@Kanol
Last active October 9, 2016 16:38
Show Gist options
  • Save Kanol/65701d9a93662f19f7c5e6cf0f3c6b67 to your computer and use it in GitHub Desktop.
Save Kanol/65701d9a93662f19f7c5e6cf0f3c6b67 to your computer and use it in GitHub Desktop.
program n4;
var a, b, h, S:real; known:integer;
begin
writeln('1 - катет');
writeln('2 - гипотенуза');
writeln('3 - высота');
writeln('4 - площадь');
write('Введите номер известной величины ');
readln(known);
write('Введите значение известной величины ');
case known of
1:begin
readln(a);
b:=sqrt(2*sqr(a));
h:=b/2;
S:=sqr(a)/2;
end;
2:begin
readln(b);
a:=sqrt(sqr(b)/2);
h:=b/2;
S:=sqr(a)/2;
end;
3:begin
readln(h);
b:=2*h;
a:=sqrt(sqr(b)/2);
S:=sqr(a)/2;
end;
4:begin
readln(S);
a:=sqrt(2*S);
b:=sqrt(2*sqr(a));
h:=b/2;
end;
end;
writeln('катет = ', a);
writeln('гипотенуза = ', b);
writeln('высота = ', h);
writeln('площадь = ', S);
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment