mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4200 7fd9a85b-ad96-42d3-883c-3090e2eb8679
17 lines
385 B
ObjectPascal
17 lines
385 B
ObjectPascal
{ a simple nested function }
|
|
|
|
program simplefunc(output);
|
|
|
|
function addmul(term1a, term1b, term2a, term2b: integer ) : integer;
|
|
function factor(terma, termb: integer ) : integer;
|
|
begin
|
|
factor := terma + termb;
|
|
end;
|
|
begin
|
|
addmul := factor(term1a, term1b) * factor(term2a, term2b);
|
|
end;
|
|
|
|
begin
|
|
writeln('(1 + 2) * (3 + 4) =', addmul(1, 2, 3, 4));
|
|
end.
|