Написано на языке PascalABC.NET
1 const
2 cValue = 2;
3 var
4 N, i: integer;
5 resultNumber: real;
6 begin
7 Readln(N);
8
9 for i := 1 to N do
10 resultNumber := resultNumber + Power(cValue, i);
11 Writeln(resultNumber);
12end.
Объяснение:
Написано на языке PascalABC.NET
1 const
2 cValue = 2;
3 var
4 N, i: integer;
5 resultNumber: real;
6 begin
7 Readln(N);
8
9 for i := 1 to N do
10 resultNumber := resultNumber + Power(cValue, i);
11 Writeln(resultNumber);
12end.
Объяснение: