文件名称:5_47908
-
所属分类:
- 标签属性:
- 上传时间:2015-11-29
-
文件大小:4.63kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
题目描述:n只猴子要选大王;
选举方法如下:所有猴子按 1,2 ……… n 编号并按照顺序围成一圈,
从第 k 个猴子起,由1开始报数,报到m时,该猴子就跳出圈外,
下一只猴子再次由1开始报数,如此循环,
直到圈内剩下一只猴子时,这只猴子就是大王。
输入数据:猴子总数n,
起始报数的猴子编号k,
出局数字m
输出数据:猴子的出队序列和猴子大王的编号-Title Descr iption: n monkeys to elect king
Elections as follows: All the monkeys by 1,2 ......... n number and the order of a circle,
From the k-th monkey, starting 1 number off, when to report m, the monkey jumped out of the loop,
Under a monkey again starting 1 reported that the number, so the cycle,
Until the remaining circle a monkey, the monkey is king.
Input Data: Total monkey n,
Reported that the number of monkeys starting number k,
Out digital m
Output data: monkey monkey king and the team sequence number
选举方法如下:所有猴子按 1,2 ……… n 编号并按照顺序围成一圈,
从第 k 个猴子起,由1开始报数,报到m时,该猴子就跳出圈外,
下一只猴子再次由1开始报数,如此循环,
直到圈内剩下一只猴子时,这只猴子就是大王。
输入数据:猴子总数n,
起始报数的猴子编号k,
出局数字m
输出数据:猴子的出队序列和猴子大王的编号-Title Descr iption: n monkeys to elect king
Elections as follows: All the monkeys by 1,2 ......... n number and the order of a circle,
From the k-th monkey, starting 1 number off, when to report m, the monkey jumped out of the loop,
Under a monkey again starting 1 reported that the number, so the cycle,
Until the remaining circle a monkey, the monkey is king.
Input Data: Total monkey n,
Reported that the number of monkeys starting number k,
Out digital m
Output data: monkey monkey king and the team sequence number
(系统自动生成,下载前可以参看下载内容)
下载文件列表
单链表的删除.cpp
单链表的插入.cpp
单链表的查找.cpp
建立单链表.cpp
猴子选王.c
单链表的插入.cpp
单链表的查找.cpp
建立单链表.cpp
猴子选王.c
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.