Napisz program przeliczający cale na centymetry oraz stopy na centymetry. Chodzi o programowanie we Free Pascal'u. 1 cal = 2,54 cm 1 stopa = 30,48 cm
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
program zadanie;
const cal = 2.54;
const stopa = 30.48;
var
x : integer;
begin
writeln ('1 - cale na cm');
writeln ('2 - stopy na cm');
readln (x);
case x of
1 :
begin
write('Podaj wartosc w calach: ');
readln (x);
writeln ( x, ' cale to ', x * cal :5:2, 'cm' );
end;
2 :
begin
write('Podaj wartosc w stopach: ');
readln (x);
writeln ( x, ' stopy to ', x * stopa :5:2, 'cm' );
end;
else writeln('Nie ma takiej opcji...');
end;
readln;
end.