4*2^x Кб = 16*2^10 Кб
4*2^x = 4*2^2*2^10
4*2^x=4*2^12
x=12
#include <iostream>
using namespace std;
int main()
{
int n;
double t = 1;
cout << "input n: ";
cin >> n;
for (int i = 1; i <= n; i++) {
t = t * (((2 * i) - 1)) / i;
}
cout << t << endl;
}
<u>Проверка:</u>
1/1 * (3/2) * (5/3) = 2.5
1/1 * (3/2) * (5/3) * (7/4) * (9/5) = 7.87500
<span>uses crt;
const nmax=100;
var x:array[1..nmax] of integer;
n,m,i,j,k,a,p:integer;
begin
clrscr;
randomize;
repeat
write('Размер массива от 2 до ',nmax,' n=');
readln(n);
until n in [2..nmax];
writeln('Исходный массив:');
for i:=1 to n do
begin
x[i]:=random(10);
write(x[i]:4);
end;
writeln;
i:=1;
m:=n;
while i<n-1 do
begin
k:=1;
a:=x[i];
for j:=n downto i+1 do
if x[j]=a then k:=k+1;
if k>2 then
begin
j:=i;
while j<=n do
if x[j]=a then
begin
if j=n then n:=n-1
else
begin
for p:=j to n-1 do
x[p]:=x[p+1];
n:=n-1;
end;
end
else j:=j+1;
end
else i:=i+1;
end;
if n=0 then
begin
exit
end;
if n=m then
write('Все элементы встречены не более 2 раз и не удалены')
else
begin
for i:=1 to n do
write(x[i]:4);
for i:=1 to n-1 do
for j:=i+1 to n do
if(i mod 2=0)and(j mod 2=0) and(x[i]<x[j]) then
begin
a:=x[i];
x[i]:=x[j];
x[j]:=a;
end;
for i:=1 to n do
write(x[i]:4);
end;</span>
Program Uskorenie;
uses Crt;
const g = 9.81;
var g1, g2, g3 : real;
begin
ClrScr;
Write (' Введите g1 ='); ReadLn(g1);
Write(' Введите g2 ='); ReadLn(g2);
Write (' Введите g3 ='); ReadLn(g3);
WriteLn;
if (g1=g) or (g2=g) or (g3=g) then WriteLn(' Есть!')
else WriteLn(' Отсутствует...');
ReadLn;
end.