文件名称:yuesefuhuan
介绍说明--下载内容均来自于网络,请自行研究使用
问题描述:编号为1,2,• • • ,n的n个人围坐在一圆桌旁,每人持有一个正整数的密码。从第一个人开始报数,报到一个预先约定的正整数m时,停止报数,报m的人退席,下一个人又重新从1开始报数,依此重复,直至所有的人都退席。编一程序输出他们退席的编号序列。例如,设m=20,n=7,7个人的密码依次是3,1,7,2,4,8,4,则退席的人的编号依次为6,1,4,7,2,3,5。
提示2:用不带表头结点的循环单链表表示围成圆圈的n个人;建立此循环单链表;某人离席相当于删除一个结点要正确设置程序中循环终止的条件和删除结点时指针的修改变化。
-Problem Descr iption: Number for the 1,2, • • • , n of n individuals sitting at a round table, each holding a positive integer password. The number of individuals starting from the first report, to report a pre-agreed a positive integer m, to stop reporting the number of people who reported m withdraw, the next person once again began to report from a few, and so repeat until all of them withdrew. Compile a program that they withdraw from the number sequence output. For example, set m = 20, n = 7,7 personal password followed by 3,1,7,2,4,8,4, then withdraw from the number of people were 6,1,4,7,2,3 , 5.
提示2:用不带表头结点的循环单链表表示围成圆圈的n个人;建立此循环单链表;某人离席相当于删除一个结点要正确设置程序中循环终止的条件和删除结点时指针的修改变化。
-Problem Descr iption: Number for the 1,2, • • • , n of n individuals sitting at a round table, each holding a positive integer password. The number of individuals starting from the first report, to report a pre-agreed a positive integer m, to stop reporting the number of people who reported m withdraw, the next person once again began to report from a few, and so repeat until all of them withdrew. Compile a program that they withdraw from the number sequence output. For example, set m = 20, n = 7,7 personal password followed by 3,1,7,2,4,8,4, then withdraw from the number of people were 6,1,4,7,2,3 , 5.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
yuesefuhuan.doc