using System;
namespace ConsoleApp11
{
class Program
{
static void Main(string[] args)
{
Console.Write("Введите N: ");
int N = int.Parse(Console.ReadLine());
double S = 0;
for (int i = 0; i < N; i++)
S += Math.Pow(-1, i) * (1 / Math.Pow(2, i));
Console.WriteLine("Ответ: " + S);
Console.ReadKey();
}
}
}
6 тысяч страниц . . . . . . .. . . . . . .. . . . . . . .. . . .
Обозначим цифры, которыми записаны числа P, Q, R и T a, b, c.
P(x) = a*x+b
Q(y) = c*y+c
R(x) = b*x+a
T(y) = a*y+b
a*x+b+c*y+c = 21
b*x+a-a*y-b = 2
Пусть a=1, b=1, c=1
x+1+y+1 = 21, x+y = 19
x+1-y-1 = 2, x-y = 2
x = y+2, y+2+y = 19, 2*y = 17 - не подходит
Пусть a=2, b=1, c=1
2*x+1+y+1 = 21, 2*x+y = 19
x+2-2*y-1 = 2, x-2*y = 1
x = 2*y+1, 2*(2*y+1)+y = 19, 5*y = 17 - не подходит
Пусть a=1, b=2, c=1
x+2+y+1 = 21, x+y = 18
2*x+1-y-2 = 2, 2*x-y = 3
y = 2*x-3, x+2*x-3 = 18, 3*x = 21
x = 7, y = 11
P(7) = 12(7) = 7+2 = 9(10)
Q(11) = 1*11+1 = 12(10)
9(10)+12(10) = 21(10)
R(7) = 2*7+1 = 15(10)
T(11) = 1*11+2 = 13(10)
15(10)-13(10) = 2(10)
Ответ: x=7, y=11
1)
<span><span>procedure Insert(source: string; var s: string; index: integer);
Вставляет подстроку source в строку s с позиции index</span><span>procedure Delete(var s: string; index, count: integer);
Удаляет из строки s count символов с позиции index
2)
var s:string; i,n,code:integer;
begin
write('Введите длинное число:');
readln(s);
for i:=1 to length(s) do
begin
val(s[i],n,code);
if code=0 then writeln(n);
end;
end.
Пример:
Введите длинное число:3456810285
3
4
5
6
8
1
0
2
8
5
Если не требуется выполнять арифметических действий с цифрами, то можно так:
var s:string; i:integer;
begin
write('Введите длинное число:');
readln(s);
for i:=1 to length(s) do writeln(s[i]);
end.</span></span>
16000 Герц * 8 бит * 2 канала * 10 сек = 2560000 бит
2560000 бит / 8 =320000 байт
320000 байт / 1024 = 312,5 Кбайт