文件名称:123
介绍说明--下载内容均来自于网络,请自行研究使用
学生搭配问题
一班有m个女生,有n个男生(m不等于n),现要开一个舞会. 男女生分别编号坐在舞池的两边的椅子上.每曲开始时,依次从男生和女生中各出一人配对跳舞, 本曲没成功配对者坐着等待下一曲找舞伴.
请设计一系统模拟动态地显示出上述过程,要求如下:
1) 输出每曲配对情况
2) 计算出任何一个男生(编号为X)和任意女生(编号为Y),在第K曲配对跳舞的情况.至少求出K的两个值.
3) 尽量设计出多种算法及程序,可视情况适当加分
提示:用队列来解决比较方便.
-Students with the problem
There are m girls, there are n boys (m is not equal to n), is to open a ball.The boys and girls were numbered sitting on both sides of the dance floor of the chair.At the beginning of each song, followed by boys and girls the out One pairing dancing, the song did not successfully match the next sit and wait for partners to find partners.
Please design a system simulation to dynamically show the above process, the requirements are as follows:
1) Output each song pairing
2) Calculate the number of any boys (numbered X) and any girls (number Y), and dance in the k-th pair.
3) try to design a variety of algorithms and procedures, as appropriate, plus points
Hint: It is convenient to use queue to solve.
一班有m个女生,有n个男生(m不等于n),现要开一个舞会. 男女生分别编号坐在舞池的两边的椅子上.每曲开始时,依次从男生和女生中各出一人配对跳舞, 本曲没成功配对者坐着等待下一曲找舞伴.
请设计一系统模拟动态地显示出上述过程,要求如下:
1) 输出每曲配对情况
2) 计算出任何一个男生(编号为X)和任意女生(编号为Y),在第K曲配对跳舞的情况.至少求出K的两个值.
3) 尽量设计出多种算法及程序,可视情况适当加分
提示:用队列来解决比较方便.
-Students with the problem
There are m girls, there are n boys (m is not equal to n), is to open a ball.The boys and girls were numbered sitting on both sides of the dance floor of the chair.At the beginning of each song, followed by boys and girls the out One pairing dancing, the song did not successfully match the next sit and wait for partners to find partners.
Please design a system simulation to dynamically show the above process, the requirements are as follows:
1) Output each song pairing
2) Calculate the number of any boys (numbered X) and any girls (number Y), and dance in the k-th pair.
3) try to design a variety of algorithms and procedures, as appropriate, plus points
Hint: It is convenient to use queue to solve.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
123.cpp