All pastes #755645 Raw Edit

Kalkulator

public text v1 · immutable
#755645 ·published 2007-10-30 20:33 UTC
rendered paste body
program kalkulator;
uses crt;

var
l1 , l2, w : real;
cmd: char;
pcmd: integer;
begin
pcmd := 1;
clrscr;
write('Podaj pierwsza liczbe: ');
readln(l1);
write('Podaj druga liczbe: ');
readln(l2);
write('Podaj znak operacji (- + , - , * , /) : ');
readln(cmd);
if (cmd <> '-') and (cmd<> '+') and (cmd <> '*') and (cmd <> '/') then
   begin
   pcmd := 0;
   writeln('Operacja niepoprawna ! Spierdalaj !')
   end
else begin
if (cmd = '-') then w := l1-l2;
if (cmd = '+') then w := l1+l2;
if (cmd = '*') then w := l1*l2;
if (cmd = '/') then
if (l2 = 0) then Writeln('Cholero nie dziel przez ZERO !')
else w := l1/l2;
end;
if (l2 <> 0) and (pcmd > 0) then
writeln('Wynik : ', w:0:0);
readln;
end.