Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
12
Task/Call-a-function/Ada/call-a-function-3.adb
Normal file
12
Task/Call-a-function/Ada/call-a-function-3.adb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
type Integer_Array is array (Positive range <>) of Integer;
|
||||
function Sum(A: Integer_Array) return Integer is
|
||||
S: Integer := 0;
|
||||
begin
|
||||
for I in A'Range loop
|
||||
S := S + A(I);
|
||||
end loop;
|
||||
return S;
|
||||
end Sum;
|
||||
...
|
||||
A := Sum((1,2,3)); -- A = 6
|
||||
B := Sum((1,2,3,4)); -- B = 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue