===== PascalABC.NET =====
type
Vector = array of real;
function operator +(a, b: Vector): Vector;
ExtensionMethod := a.Zip(b, (p, q) -> p + q).ToArray;
function operator -(a, b: Vector): Vector;
ExtensionMethod := a.Zip(b, (p, q) -> p - q).ToArray;
function operator *(s: real; a:Vector): Vector;
ExtensionMethod := a.ConvertAll(p -> p * s);
begin
var a: Vector := ReadArrReal('Вектор a:', 3);
var b: Vector := ReadArrReal('Вектор b:', 3);
var c: Vector := ReadArrReal('Вектор c:', 3);
var k := ReadReal('k =');
Println(k * (a + b) + (1 - k) * (a + c))
end.
===== PascalABC.NET =====
type
Vector = array of real;
function operator +(a, b: Vector): Vector;
ExtensionMethod := a.Zip(b, (p, q) -> p + q).ToArray;
function operator -(a, b: Vector): Vector;
ExtensionMethod := a.Zip(b, (p, q) -> p - q).ToArray;
function operator *(s: real; a:Vector): Vector;
ExtensionMethod := a.ConvertAll(p -> p * s);
begin
var a: Vector := ReadArrReal('Вектор a:', 3);
var b: Vector := ReadArrReal('Вектор b:', 3);
var c: Vector := ReadArrReal('Вектор c:', 3);
var k := ReadReal('k =');
Println(k * (a + b) + (1 - k) * (a + c))
end.