var n,k,i,s: integer;
begin
write('n = ');
readln(n);
if n<100 then k:=n else k:=99;
s:=0;
for i:=1 to k div 11 do s:=s+i*11;
writeln('s = ',s);
end.
Пример:
n = 40
s = 66
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var n,k,i,s: integer;
begin
write('n = ');
readln(n);
if n<100 then k:=n else k:=99;
s:=0;
for i:=1 to k div 11 do s:=s+i*11;
writeln('s = ',s);
end.
Пример:
n = 40
s = 66