Jednoduchá kalkulačka
Delphi & Pascal (česká wiki)
Kategorija: KMP (Programy mladňakoch
Program: Kalkulacka4.pas
Subor exe: Kalkulacka4.exe
Program: Kalkulacka4.pas
Subor exe: Kalkulacka4.exe
Jednoduchá kalkulačka.
{ KALKULACKA.PAS } { Jednoducha kalkulacka. } { } { Datum:26.11.2011 http://www.trsek.com } program kalkulacka; uses crt; var a,b : real; n : char; begin clrscr; repeat writeln('Zadaj cislo'); readln(a); writeln('Zadaj operator (+,-,*,/), 0 = end'); n:= readkey; if ord(n)<>48 then begin writeln(n); writeln('Zadaj cislo'); readln(b); case n of '+': a:=a+b; '-': a:=a-b; '*': a:=a*b; '/': a:=a/b; end; writeln(' '); writeln('= ',a:3:2); writeln(' '); end else break; until ord(n)=48; end.