
4 Σ (S!+S) S=1 найдите ошибку, плиз program mar;uses crt;var
F,S:integer;k:real;beginclrscr;F:=1;k:=0;for S:=1 to 4 dobeginF:=F*S;k:=k*(F+S);end;writeln('k =',k:4:2);readkey;end.

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

The code you provided seems to have a few errors. Let's go through them step by step:
1. The line `program mar;` should be changed to `program mar;`. 2. The line `uses crt;` is unnecessary and can be removed. 3. The line `var F, S: integer;` is missing a semicolon at the end. It should be `var F, S: integer;`. 4. The line `k: real;` is missing a semicolon at the end. It should be `k: real;`. 5. The line `beginclrscr;` should be changed to `begin clrscr;`. 6. The line `for S := 1 to 4 do` is missing a space between `to` and `4`. It should be `for S := 1 to 4 do`. 7. The line `F := F * S;` is correct. 8. The line `k := k * (F + S);` is incorrect. It should be `k := k + (F + S);` to calculate the sum of `k`, `F`, and `S`. 9. The line `writeln('k+=', k:4:2);` is correct. 10. The line `readkey;` is correct. 11. The line `end.` is missing a semicolon at the end. It should be `end;`.
Here's the corrected code:
```pascal program mar; var F, S: integer; k: real; begin clrscr; F := 1; k := 0; for S := 1 to 4 do begin F := F * S; k := k + (F + S); end; writeln('k = ', k:4:2); readkey; end; ```
This code calculates the value of `k` using a loop. It multiplies `F` by `S` in each iteration and adds the sum of `F` and `S` to `k`. Finally, it prints the value of `k`.


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







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili