All pastes #755675 Raw Edit

Kalkulator8

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

var
l1 , l2, w, uw : 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
case cmd of
'-': w := l1-l2;
'+': w := l1+l2;
'*': w := l1*l2;
'/':
if (l2 = 0) then
begin
 pcmd := 0;
 Writeln('Cholero nie dziel przez ZERO !');
end
else w := l1/l2;
end;
    end;
if pcmd > 0 then
begin
     Write('Podaj wynik: ');
     readln(uw);
     if uw = w then Writeln('Wynik Poprawny')
     else Write('Wynik niepoprawny');
end;
readln;
end.