Hello,software comrades!
I have a task to do, and I have figured some part of it,but I have troubles with it.So i am writing and asking for some advice.
The task is as it follows: You are to create a program (C++ language) in which u enter a number (preferably between 5-10) and it creates some disks and numbers them between 1 and the entered number( it has to be even).Then in separates the disks with even and uneven numbers.We are given 3 poles -A,B,C. On pole A we have all disks with even number(the biggest numbers is at the bottom whereas the lowest on top) and on pole B we have the ones with uneven number.The program is to switch the places on the disks ,meaning that pole A should contain the uneven and pole B the even. We can move 1 disk per turn and we can NOT put a bigger number disk on top of a smaller one.It has to print out the number of moves it will require to do the above.
I have solved the task using real life disks and poles,and analyzed it a bit,but i have some trouble with creating the algorithm for making it.So I am asking you guyz for some help with creating that algorithm.Or if u have any ideas please share them.
Thanks in advance!