Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Dot-product/DWScript/dot-product-1.dw
Normal file
12
Task/Dot-product/DWScript/dot-product-1.dw
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function DotProduct(a, b : array of Float) : Float;
|
||||
require
|
||||
a.Length = b.Length;
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
for i := 0 to a.High do
|
||||
Result += a[i]*b[i];
|
||||
end;
|
||||
|
||||
PrintLn(DotProduct([1,3,-5], [4,-2,-1]));
|
||||
4
Task/Dot-product/DWScript/dot-product-2.dw
Normal file
4
Task/Dot-product/DWScript/dot-product-2.dw
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
var a := Vector(1, 3, -5, 0);
|
||||
var b := Vector(4, -2, -1, 0);
|
||||
|
||||
PrintLn(a * b);
|
||||
Loading…
Add table
Add a link
Reference in a new issue