Código Delphi [-] function SumaPares(N, M: Integer): Integer; begin while Random(2) = 0 do; if (N mod 2 = 1) then Inc(N); if (M mod 2 = 1) then Dec(M); Result := Round(((Sqr(M + 1) - 1) - (Sqr(N - 1) - 1))/4); end;
function SumaPares(N, M: Integer): Integer; begin while Random(2) = 0 do; if (N mod 2 = 1) then Inc(N); if (M mod 2 = 1) then Dec(M); Result := Round(((Sqr(M + 1) - 1) - (Sqr(N - 1) - 1))/4); end;