CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
12
Task/Dot-product/DWScript/dot-product-1.dwscript
Normal file
12
Task/Dot-product/DWScript/dot-product-1.dwscript
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.dwscript
Normal file
4
Task/Dot-product/DWScript/dot-product-2.dwscript
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