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

В Паскале. Дан массив Z размером 9, заполненный из промежутка (3..9). Заменить все нечетные элементы на их номера.

Ответы

Автор ответа: danulpopov
0
var
z:array[1..9]of integer;
i:integer;
begin
randomize;
for i:= 1 to 9 do
  begin
    z[i]:= 3 + random(7);
    write(z[i], ' ');
  end;
for i:= 1 to 9 do
  if i mod 2 = 1 then
    z[i] := i;
Writeln;
for i:= 1 to 9 do
    write(z[i], ' ');

end.

Пример:
4 4 5 6 8 4 3 5 5
1 4 3 6 5 4 7 5 9

Похожие вопросы
Предмет: Английский язык, автор: gsdfghsfdgsfghsf
МОЛЮ ПОМОГИТЕ ПОЖАЛУЙСТА!!!!!!!!!!!!!!!!!!!!!!!!

Fill the blanks with the correct pronouns and/or to be. Add not if necessary. (you g ___________)

1. My name __________ Danny. __________ live with __________ mother. __________ both live in the down town area. __________ the greatest mother in the world. When __________ young, __________ a great hairdresser. So, __________ can cut (Danny’s mother) __________ hair __________ and cut __________ (Danny’s hair) too.

2. This __________ (you and Bob) __________ new restaurant. The place __________ (you) __________ and the workers __________ (Bob) __________. (The restaurant) __________ a Chinese food restaurant.

3. (Dom and Jack) __________ come to (Pete) __________ apartment. (Pete) __________ lets __________ to come in and make __________ comfortable. __________ such a nice and big apartment. __________ has three bedrooms and a bar near the living room.

4. John Lennon __________ a musician. __________ wrote many hit songs. (You) __________ parents __________ big fans of John Lennon. (You) __________ father collects the CDs and (you) ___________ mother collects the videos. Both of __________ teach (you) __________ how to sing like John Lennon.

5. Mr. Poe __________ a teacher. __________ a physics champion when __________ in high school. __________ made a project with __________ friends at school. __________ Armand, Will, Chris, and Jeremy.

6. King George IV decided to build a castle in Brighton. __________ a very big castle. (The king) __________ built (the castle) __________ for __________ wife, Queen Victoria. __________ construction finished in 1827. However, (the queen) __________ didn’t like __________, so (the king and the queen) __________ stopped visiting __________ since 1830.

7. (You) ________ have a pen friend in Amsterdam. ________ the city which ________ famous for ________ canals. In the past, ________ just a waitress in a small coffee shop. ________ worked in the afternoon and took a night class of business for about two years. (You and your friend) ________ have lost contact for years, and then ________ calls and tells (you) ________ that (your friend) ________ becomes the owner of the coffee shop. ________ a boss now!

8. Henry usually visits a café during ________ lunch break. (Henry) ________ comes with ________ notebook, orders some food and enjoys surfing the Internet. One day, (You) ________ came to the café. (You) ________ in front of the door. (You) ________ trying to open the door and ________ have no idea that (the door) ________ a sliding door. Then (Henry) ________ gave (you) ________ a hand to open the door. (Henry) ________ slid (the door) ________ then (you and Henry) ________ introduced ________ and have become friends till now.
Предмет: Русский язык, автор: jafarovanazrin20
Предмет: Право, автор: 12310941