値を返さない関数・仮引数を受け取らない関数
明解C言語 入門編 > 6. 関数 >
値を返さない関数・仮引数を受け取らない関数
Delphi
program Project1;{$APPTYPE CONSOLE}
uses
SysUtils;var
n1, n2, n3: Integer;procedure max3();
var
max: Integer;
begin
max := n1;if n2 > max then max := n2;
if n3 > max then max := n3;writeln(format('最も大きい値は%dです。', [max]));
end;begin
writeln('3つの整数を入力してください。');write('整数1:');
read(n1);write('整数2:');
read(n2);write('整数3:');
read(n3);max3;
end.
実行結果
S:\>lesson045\project1.exe
3つの整数を入力してください。
整数1:83
整数2:45
整数3:25
最も大きい値は83です。