Предмет: Информатика, автор: Vedmeyga

Помогите!
for i := 0 to 99 do num[i+1]:=i+1;
k:=0;
i:=1;
while k<7 do begin
if easy(num[i]) = true
then k:=k+1;
i:=i+2
end;
write(num[i-2]);
В программе использованы две целочисленные переменные i и k, целочисленный массив num из ста элементов, с индексами от 1 до 100. Также определена функция easy() логического типа данных, которая возвращает истинное значение в случае, если переданный в неё целочисленный аргумент является простым числом, и ложное значение - в противном случае. Какое число будет выведено в результате выполнения этой программы?

Ответы

Автор ответа: superclesher11
0
Если дальше завершить программу, то получим это:
program HelloWorld;
    function ez(a: longint): boolean;        var c: integer;        begin            ez := a >= 2;            for c := 2 to trunc(sqrt(a)) do if a mod c = 0 then ez := false        end;        var i, k: integer;        num: array [1 .. 100] of integer;
begin    for i := 0 to 99 do num[i+1] := i + 1;        k := 0;    i := 1;        while k < 7 do begin        if ez(num[i]) = true            then k := k + 1;        i := i + 2;    end;        write(num[i-2]);    end.
Ответ 19

Похожие вопросы
Предмет: Английский язык, автор: meshkovahatasha
Complete the sentences using the verbs in brackets in the
present simple or the present continuous.
1. Tina usually _________ (drink) coffee but today she ___________
(have) a cup of tea.
2. Alan _________ (like) playing chess but right now he _________
(play) cards with his nephew.
3. John and his mother _______ (come) back from the supermarket.
They have bought a lot of things.
4. Tina always _________ (do) the ironing on Saturday mornings.
5. Ted ______________ (not often/ read) the paper. Today he
_________ it because there is an article about the company he ______
(work) for.
6. Ana _________ for the bus. She _________ (go) to a meeting.
7. Sandra _________ (wear) a raincoat today because it’s likely to
rain.
8. Bill _____________ (sit) in his armchair. He ____________ (not
watch) TV. He _________ (read) the newspaper.
9. Peter ____________ (go) to a meeting and he´s late.
10. Look! Sophie _____________ (run) very fast. She _________ (go)
jogging every morning.
11. Paul _________ (work) as an architect. Now he _________ (draw)
the plan of a new building
12. Lisa isn’t at home. She _________ (have) a walk with her dog.
13. This evening Fred and Lara _________ (have) dinner at a new
restaurant.
14. Ted _________ (work) as a mechanic. At the moment he
________ (repair) my car.
15. Tom always _________ (have) lunch at 12:30.
16. Bill _________ (feed) his cat twice a day.
17. Look! Dave _________ (run) to catch the bus
18. My brother _________ (go) to the gym every weekend.
Предмет: Математика, автор: elizaveta2808