program zadanie;uses crt;varr,h,v :real;k :integer;beginclrscr;writeln ('1. Obj©to† kuli');writeln ('2. Obj©to† walca');write ('Opcja nr: ');readln (k);if k=1 thenbeginclrscr;write ('Podaj promien kuli: ');readln (r);writeln ('Wzor na objetosc kuli: V=4/3*pi*r^3');v:=4/3*pi*r*r*r;writeln (v:2:2);end;if k=2 thenbeginclrscr;write ('Podaj promien podstawy walca: ');readln (r);write ('Podaj wysokosc walca: ');readln (h);writeln ('Wzor na objetosc walca: V=pi*r^2*h');v:=pi*r*r*h;writeln (v:2:2);end;readln;end.
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
program zadanie;
uses crt;
var
r,h,v :real;
k :integer;
begin
clrscr;
writeln ('1. Obj©to† kuli');
writeln ('2. Obj©to† walca');
write ('Opcja nr: ');
readln (k);
if k=1 then
begin
clrscr;
write ('Podaj promien kuli: ');
readln (r);
writeln ('Wzor na objetosc kuli: V=4/3*pi*r^3');
v:=4/3*pi*r*r*r;
writeln (v:2:2);
end;
if k=2 then
begin
clrscr;
write ('Podaj promien podstawy walca: ');
readln (r);
write ('Podaj wysokosc walca: ');
readln (h);
writeln ('Wzor na objetosc walca: V=pi*r^2*h');
v:=pi*r*r*h;
writeln (v:2:2);
end;
readln;
end.