文件名称:123
-
所属分类:
- 标签属性:
- 上传时间:2016-12-13
-
文件大小:689byte
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
学生搭配问题
一班有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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.