program MinNumber; function Min(a, b, c, d: Integer): Integer; begin Result := a; if b < Result then Result := b; if c < Result then Result := c; if d < Result then Result := d; end; var a, b, c, d, minNum: Integer; begin writeln('Enter four numbers:'); readln(a, b, c, d); minNum := Min(a, b, c, d); writeln('The minimum number is: ', minNum); end.
Пример использования:
Enter four numbers: 5 7 3 9 The minimum number is: 3
function Min(a, b, c, d: Integer): Integer;
begin
Result := a;
if b < Result then
Result := b;
if c < Result then
Result := c;
if d < Result then
Result := d;
end;
var
a, b, c, d, minNum: Integer;
begin
writeln('Enter four numbers:');
readln(a, b, c, d);
minNum := Min(a, b, c, d);
writeln('The minimum number is: ', minNum);
end.
Пример использования:
Enter four numbers:5
7
3
9
The minimum number is: 3