program SumOrSubtraction;
vara, b: integer;
function Calculate(a, b: integer): integer;beginif a = b thenCalculate := a + belseCalculate := b - a;end;
beginwriteln('Enter a:');readln(a);writeln('Enter b:');readln(b);
writeln('Result: ', Calculate(a, b));end.
program SumOrSubtraction;
var
a, b: integer;
function Calculate(a, b: integer): integer;
begin
if a = b then
Calculate := a + b
else
Calculate := b - a;
end;
begin
writeln('Enter a:');
readln(a);
writeln('Enter b:');
readln(b);
writeln('Result: ', Calculate(a, b));
end.