Вопрос задан 08.05.2019 в 12:40. Предмет Информатика. Спрашивает Осяк Ангелина.

Найти сумму вида 1/2+1/4+1/6..... n раз? Вывести на экран слово "привет" n раз? Прошу, очень

нуждаюсь в помощи, не понимаю ничего!!!! Дам 15 баллов!!
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Жигжитов Бэлик.
Var
N,i:integer;
S:real;
Begin
Write('N = ');ReadLn(N);
i:=0;
For N:= 1 to N do
    Begin
    i:=i+2;
    S:=S+1/i;
    End;
WriteLn(S)
End.




Var
N:integer;
Begin
Write('N = ');ReadLn(N);
For N:= 1 to N do
    WriteLn('привет')
End.

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Sum of Fractions

To find the sum of fractions of the form 1/2, 1/4, 1/6, and so on, we can use the concept of harmonic series. The harmonic series is the sum of the reciprocals of positive integers. In this case, we have a harmonic series where the denominators are multiples of 2.

The formula to find the sum of the first n terms of a harmonic series is:

S = 1/1 + 1/2 + 1/3 + ... + 1/n

In our case, the denominators are multiples of 2, so the formula becomes:

S = 1/2 + 1/4 + 1/6 + ... + 1/(2n)

To calculate this sum, we can use the formula for the sum of the first n terms of a harmonic series:

S = (1/2) + (1/4) + (1/6) + ... + (1/(2n)) = ln(2n) + γ

where ln is the natural logarithm and γ is the Euler-Mascheroni constant.

Let's calculate the sum for a given value of n.

Word "Привет" Repeated n Times

To display the word "привет" (which means "hello" in Russian) n times on the screen, we can use a loop in a programming language. The specific code will depend on the programming language you are using.

Here's an example in Python:

```python n = 5 # Replace with the desired number of repetitions

for _ in range(n): print("привет") ```

This code will print the word "привет" 5 times. You can change the value of `n` to the desired number of repetitions.

I hope this helps! Let me know if you have any further questions.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос