<span>U(i) = U(i-1) + L(i-1), а L(i) = L(i-1) + L(i-2)? </span>
<h3>PascalABC.NET 3.4.2, сборка 1814 от 02.10.2018
</h3>
begin
var count := 0;
var a := Range(ReadInteger('a='), ReadInteger('b='))
.Select(t -> t.ToString.JoinIntoString(' ').ToIntegers)
.Where(t -> t.Count.IsEven);
foreach var x in a do
begin
var (b, i) := (true, 0);
while (b) and (i < x.Length - 1) do
begin
if (x[i].IsOdd and x[i + 1].IsOdd) or (x[i].IsEven and x[i + 1].IsEven)
then b := false;
inc(i, 2);
end;
if (i = x.Length) and (b) then inc(count);
end;
count.Println;
end.
var
P:array[2..100000] of boolean;
i, n, pr:integer;
flag:boolean;
begin
write('max = ');
readln(n);
for i := 2 to n do
P[i] := true;
pr := 2;
flag := true;
while flag do
begin
i := 2 * pr;
while i <= n do
begin
P[i] := false;
i := i + pr;
end;
flag := false;
for i := pr + 1 to n do
if P[i] then
begin
pr := i;
flag := true;
break;
end;
end;
for i := 10 to n do
if P[i] then
writeln(i);
readln;
end.
Итак, алгоритм прост:
Площадь = а * б * с
<em>Периметр = а + б + с</em>
<em>Могу реализовать это же на паскале:</em>
<h3>
<em>var a,b,c,s,p:integer;</em></h3><h3>
<em>begin</em></h3><h3>
<em>read(a,b,c);</em></h3><h3>
<em>s:=a*b*c;</em></h3><h3>
<em>p:=a+b+c;</em></h3><h3>
<em>Write(s,' ',p);</em></h3><h3>
<em>end.</em></h3>
Если мой ответ вам помог - выберите его лучшим :)
Заранее спасибо