Var i,a1,a2:integer;
sum:longint;
begin
a1:=1;
a2:=2;
sum:=0;
while (a1<102) or (a2<102) do
begin
sum:=sum+(a1*a2);
a1:=a2+1;
a2:=a1+1;
end;
writeln(sum);
end.
//программа находит количество всех делителей числа, включая само число и 1
Program n1;
var x,i,k: integer;
begin
readln(x);
k:=0;
for i:=1 to x do if x div i=x/i then k:=k+1;
write('кол-во целых делителей числа ',x,': ',k);
end.
Sub MyTest()
Dim a As Variant, i As Integer
a = Range("A1:B5")
For i = 1 To 5
Cells(i, 3) = S(a(i, 1), a(i, 2))
Next i
End Sub
Function S(ByVal x As Double, ByVal y As Double) As Double
Dim i As Integer
If x < y Then
S = 0
For i = 1 To 20
S = S + x ^ i * y ^ (i + 1)
Next i
ElseIf x > y Then S = (x * y) ^ 2
Else: S = x * x + y * y
End If
End Function
x - по колонке A1:A5, y - по колонке B1:B5, результат в C1:C5
Var
s:string;
i,k:integer;
nc:boolean;
begin
readln(s);
for i:=1 to length(s) do
begin
if ( (i=1) or (s[i-1]=' ') ) and (s[i]<>' ') then
nc:=true;
if (nc=true) and ( (s[i]=' ') or (i=length(s)) then
begin
nc:=false;
inc(k);
end;
end;
writeln(k);
<span>end. </span>