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

Написать программу, которая вводит массив из N вещественных чисел, а затем заменяет в нём все элементы, превышающие данное число Z, этим числом. Вывести на экран полученный массив и количество замен. Протестировать программу на следующих исходных данных:
а) Z=10 Массив: 1,2 2,6 3 -4,5 11  10,2 3,2 87 -15
б) Z=-2 Массив: 0 -3,1 11 -7,9 -2,1 -1,9 4

4. При поступлении в ВУЗ абитуриенты, получившие «двойку» на первом экзамене, ко второму не допускаются. В массиве A[N] записаны оценки экзаменующихся, полученных на первом экзамене. Подсчитать, сколько человек не допущено ко второму экзамену.

Ответы

Автор ответа: sama9imyj15
0

Ответ:

const

n=10;

var

a:array [1..n] of real;

z,i,k:integer;

begin

for i:=1 to n do

begin

write ('A[',i,'] = ');readln(a[i]);

end;

write ('Z = ');readln(z);

for i:=1 to n do

if a[i]>z then begin

a[i]:=z;

k:=k+1;

end;

for i:=1 to n do

if frac(a[i])=0 then write (a[i]:0:0,' ') else write (a[i]:0:1,' ');

writeln ('Kol-vo zamen: ',k);

readln;

end.

Объяснение:

Похожие вопросы
Предмет: Английский язык, автор: Тадамс
Помогите раскрыть скобки
1. We hardly (toleave) town, when it (to begin) to rain
. 2. The moon (not to rise). There wasnothing to dispel the dark of the night
. 3. On glancing at the address, heobserved that it contained no name. The stranger (not to go) far, so hefollowed him to ask it. 4.  When at hishouse, they (to tell) me that he (to leave) an hour ago.
 5. No sooner he (totake) a drink himself, than Mrs Fettle (to look) in. 
6. When I (to come) to seemy friend, I (to find) him lying in bed. He (to look) very pale as he (to be)seriously ill for a whole month. 7. He hardly (to light) another cigarette,when the general (to come) into the courtyard. 
8. Gemma went slowly down thestairs, Martini following in silence. She (to grow) to look ten years older inthese few days, and her hair (to become) gray. 
9. Presently the sounds ofvoices and footsteps approaching along the terrace roused her from the dreamystate into which she (to fall). 10. She was a woman of nearly fifty who (to be)obviously pretty one. 11. Margaret, you (read) my letters, Don’t deny it.12. I (read) the book you lent me but I (not/finish) it yet.13. When I (come) home, Mother (make) breakfast and Father (have) hismother tea.14. We (climb) for six hours already, but we (not/reach) the top of themountain.15. I (know) him very well. We (know) each other since I came to live inthis house.16. I must not letmy eyes get all red and swollen, or Henry’ll know I (cry).17. Where he (be)? –He (sit) at his desk. He (not/move) since she (leave).18. A little boy(fall off) a ladder and (hurt) himself.19. He (finish) thefirst part of his book and now he (write) the second.20. Sorry I’m late.– That’s all right. I (not/wait) long.21. I (meet) Ann ather father’s house twenty years ago and (know) her ever since.22. I (make) myreport when you (enter) the room.23. Why your hair(be) wet? You (swim)?