1.
var n,i,s:integer;
begin
readln(n);
s:=0;
for i:=1 to n do s:=s+i*i;
writeln('s = ',s);
end.
Пример:
2
5
2.
var n,i,f:integer;
begin
readln(n);
f:=1;
for i:=1 to n do f:=f*i;
writeln(f);
end.
Пример:
3
6
3.
var n,i,f:integer; s:real;
begin
readln(n);
s:=1;
f:=1;
for i:=1 to n do
begin
f:=f*i;
s:=s+1/f;
end;
writeln(s:6:4);
end.
Пример:
3
2.6667
4.
var i:integer;
begin
for i:=1 to 9 do
writeln(9,' * ',i,' = ',9*i);
end.
Результат:
9 * 1 = 9
9 * 2 = 18
9 * 3 = 27
9 * 4 = 36
9 * 5 = 45
9 * 6 = 54
9 * 7 = 63
9 * 8 = 72
9 * 9 = 81