Найти сумму ряда S = 1 * 2 + 2 * 3 * 4 + …. N + (N + 1) … 2N — Pascal(Паскаль)

uses crt;
var i,j,n:byte;
    summa,s:longint;
begin
  clrscr;
  write('n=');
  readln(n);
  summa:=0;
  for i:=1 to n do
  begin
    s:=i;
    for j:=1 to i do
      s:=s*(j+i);
    summa:=summa+s;
  end;
  write('s=');
  writeln(summa);
  readln;
end.

Leave a Comment

7 + 2 =