-
3. 约瑟夫环问题。设编号为1,2,…,n(n>0)个人按顺时针方向围坐一圈。开始时任意给出一个报数上限值m,从第一个人开始顺时针方向自1起顺序报数,报到...
3. 约瑟夫环问题。设编号为1,2,…,n(n>0)个人按顺时针方向围坐一圈。开始时任意给出一个报数上限值m,从第一个人开始顺时针方向自1起顺序报数,报到m时停止报数,报m的人出列,从他在顺时针方向上的下一个人起重新自1起顺序报数;报到m的人出列;如此下去,直到所有人全部出列为止。用带头结点的单循环链表作数据元素的存储结构。
数据输入:
第一行为人数n。
第二行为报数值m。
数据输出:
依次输出出列人员的编号。
示例:
输入文件input3.txt:
4
3
4 1 3 2
输出:(标准输出)
3 2 4 1
-3. Joseph Central problems. Located numbered 1,2, ..., n (n
- 2022-05-14 13:51:18下载
- 积分:1
-
Intel ? Fortran Compiler Options Quick Reference Guide for Linux Systems
Intel® Fortran Compiler Options Quick Reference Guide for Linux Systems-Intel ? Fortran Compiler Options Quick Reference Guide for Linux Systems
- 2022-04-14 19:37:40下载
- 积分:1
-
a good JAVA guestbook.zip
一个不错的JAVA guestbook.zip-a good JAVA guestbook.zip
- 2022-06-26 03:43:48下载
- 积分:1
-
ARM S3C44B0 reading and writing to external flash process, a slight modification...
ARM S3C44B0对外部flash的读写程序,稍微修改就可以用到你的程序当中-ARM S3C44B0 reading and writing to external flash process, a slight modification on the procedure you can use them
- 2022-11-24 22:20:02下载
- 积分:1
-
css是用来设置html样式的一种语言,本文档给出了相当详细的解释,给用户以指导...
css是用来设置html样式的一种语言,本文档给出了相当详细的解释,给用户以指导-css is a kind of computor language which is used to set the style of html web page. Here this document give out very detailled explanation of this technology
- 2023-03-28 12:00:03下载
- 积分:1
-
C C++文件使用的自学习
C C++ document use for self studying
- 2022-02-02 15:53:35下载
- 积分:1
-
Linux 2.6下Driver开发的34个变化[转贴],随着Linux2.6的发布,各个设备的驱动程序在不同程度上要进行改写。...
Linux 2.6下Driver开发的34个变化[转贴],随着Linux2.6的发布,各个设备的驱动程序在不同程度上要进行改写。-Driver under Linux 2.6 development 34 changes [posted], with the release of Linux2.6 various device driver to varying degrees, to be rewritten.
- 2023-03-03 18:15:02下载
- 积分:1
-
汇编语言程序员的真实语言
Assembly Language The True Language of Programmers-Assembly Language The True Language of Pro grammers
- 2023-06-22 05:35:04下载
- 积分:1
-
QT3的技术文档,QT公司代表权。
QT3 技术文档,QT公司提供,较权威。-Qt3 technical documentation, QT companies, representing the authority.
- 2022-02-19 22:30:20下载
- 积分:1
-
html的语法卡片,简洁实用,实乃初学html的必备手册
html的语法卡片,简洁实用,实乃初学html的必备手册-html syntax cards, concise and practical, a bit of the requisite learning html manual
- 2023-03-07 00:15:04下载
- 积分:1