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

У исполнителя Увеличитель две команды, которым присвоены номера:
1. прибавь 2
2. умножь на 3
Первая из них увеличивает число на экране на 2, вторая увеличивает его в 3 раза.Составьте алгоритм получения из числа 4 числа 58, содержащий не более 5 команд. В ответ запишите только номера команд.

Как это решить? С подробным объяснением пожалуйста!)

Ответы

Автор ответа: egrBO
0
Пойдем обратным путем и уменьшим число 58 до 4 с помощью 5 команд. 5+8=13, значит 58 на 3 не делится. Значит вычтем 2. 58-2=56. 56 на три не делится, значит опять вычтем 2. 56-2=54. 54 на три делится. 54/3=18. 18 на три делится. 18/3=6 . 6 делится на 3, но нам нужна 4, поэтому вычтем 2 . 6-2=4. Мы использовали команды 11221, но для обратных действий, поэтому для получения из 4 числа 58 нам нужен обратный алгоритм, тоесть 12211.
4+2=6
6*3=18
18*3=54
54+2=56
56+2=58
Похожие вопросы
Предмет: Английский язык, автор: Аноним
I.READINGTask 1. Read the text and write True (T) or False (F) next to the sentences My Favourite Sport (Tennis) We all need exercise. This is true for young people as well as for adults. Even if you don't plan to make sports your main occupation. Thisis my opinion and I feel like it is true.As long as I can remember myself I was always keen on tennis. I love this sport with its old noble traditions, though I have never dreamed of becoming anything more than an amateur.I watch attentively all tennis competitions and championships. There are a lot of them, but my favourite championship is Wimbledon because old tennis traditions remain there as they are. Some of the most well-known Wimbledon champions are: John McEnroe, Boris Becker, Steffi Graf, Monica Seles. My dream is to get a chance to watch at least one of them playing. And meantime I play tennis with my friends. It is also a great opportunity to socialize with people who have similar interests. 1.Even if you don't plan to make sports your main occupation you need exercise. 2.I can remember myself I was always keen on table tennis. 3.I haven’t dreamed of becoming anything more than an amateur. 4.I can’t watch all tennis competitions and championships. 5.My favourite championship is Wimbledon because old tennis traditions remain there as they are. 6.Some of the most unknown Wimbledon champions are: Boris Becker, Monica Seles. II.WRITING Task2. Choose one card and do the tasks. Card1 Write an email to a pen-friend. Give information about you. The following questions help you to write. What is your name? How old are you?Where are you from? What is your favorite music? What is your hobby?What is your favorite sport? III.Speaking .Task 3.Look at the pictures and describe it.What are your favourite places for a holiday? What do you do when you’re on holiday? Do you make videos when you are on holiday?Do you like make shopping​