-
October 7th, 2011, 02:03 AM
#1
The sweet program
hi
im new to programming!
my problem:
n children numbered 1 to n are sitting in a circle. starting at child 1, a sweet is passed. after m passes the child holding the sweet is eliminated. if child x gets eliminated he gives the sweet to child x+1 and leaves the ring. that does not count far a pass. the children in the circle close ranks and the game continues with the child who was sitting after the eliminated child,taking the sweet. assume m is constant for each elimination.
write a program that will determine which child would get the sweet in the end.
I'm totally confused please help!!!!!!
How would i go about solving such a problem?
regards
warren
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|