
Co tu jest źle? O.o
program kalkulator; uses crt; var wybor, wynik, liczba1, liczba2:integer; begin writeln('Wybierz mozliwe dzialanie:'); writeln('1 - Dodawanie.'); writeln('2 - Odejmowanie. '); writeln('3 - Mnozenie. '); writeln('4 - Dzielenie. '); readln(wybor); clrscr; writeln('Wpisz 1 liczbe: '); readln(liczba1); writeln('Wpisz 2 liczbe: '); readln(liczba2); if (integer(wybor) = 1) then wynik:= liczba1 + liczba2; if (integer(wybor) = 2) then wynik:= liczba1 - liczba2; if (integer(wybor) = 3) then wynik:= liczba1 * liczba2; if (integer(wybor) = 4) then wynik:= liczba1 / liczba2; repeat until keypressed; write(wynik); end.
Nie idzie go skompilować.. Krzyczy że błąd w linii gdzie jest if co do wartosci wybor = 4 O.o
kalkulator.pas(40,25) Error: Incompatible types: got "Extended" expected "SmallInt"
kalkulator.pas(53,6) Fatal: There were 1 errors compiling module, stopping
kalkulator.pas(0) Fatal: Compilation aborted