文件名称:joseph
-
所属分类:
- 标签属性:
- 上传时间:2013-05-20
-
文件大小:41.72kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
约瑟夫环:由约瑟夫环的游戏规则可知,在游戏中,我们需要输入的是总人数n值、一开始选的上限值m和每个人手中所持的密码值cipher。这些数都应该是正整数,且n小于等于30,若输入的是小于等于0的数,应该提醒输入有误。用scanf()函数实现输入操作,空格、回车或者Tab键位输入结束标志。
在程序根据输入的数据运行之后,按顺序输出出列人的编号num,用printf()函数实现。
程序执行的命令包括:①构造结构体;②链表动态内存申请;③逐个插入链表结点并储存结点内容;④形成循环链表;⑤删除结点并输出数据。
测试数据
m初值为20,n=7,7个人密码依次为:3,1,7,2,4,8,4
出列人的编号顺序是:6,1,4,7,2,3,5.-Josephus: Josephus rules of the game that, in the game, we need to enter the value of n is the total number began to select the upper limit of m and each held by the hands of the password value cipher. These numbers should be a positive integer and n is less than or equal to 30, if the input is less than or equal to 0, should remind entered incorrectly. Scanf () function input operation, space, Enter or Tab key bit input end marker. In the program run in accordance with the input data, output in order column No. num, with the printf () function to achieve. Program execution commands include: ① tectonic structure (2) linked list dynamic memory application (3) one by one into the linked list of nodes and storage node (4) the formation of a circular list the ⑤ delete nodes and output data. Test data initial value of 20 m, n = 7,7 Password: 3,1,7,2,4,8,4 out of the line numbering sequence is: 6,1,4,7,2,3 , 5.
在程序根据输入的数据运行之后,按顺序输出出列人的编号num,用printf()函数实现。
程序执行的命令包括:①构造结构体;②链表动态内存申请;③逐个插入链表结点并储存结点内容;④形成循环链表;⑤删除结点并输出数据。
测试数据
m初值为20,n=7,7个人密码依次为:3,1,7,2,4,8,4
出列人的编号顺序是:6,1,4,7,2,3,5.-Josephus: Josephus rules of the game that, in the game, we need to enter the value of n is the total number began to select the upper limit of m and each held by the hands of the password value cipher. These numbers should be a positive integer and n is less than or equal to 30, if the input is less than or equal to 0, should remind entered incorrectly. Scanf () function input operation, space, Enter or Tab key bit input end marker. In the program run in accordance with the input data, output in order column No. num, with the printf () function to achieve. Program execution commands include: ① tectonic structure (2) linked list dynamic memory application (3) one by one into the linked list of nodes and storage node (4) the formation of a circular list the ⑤ delete nodes and output data. Test data initial value of 20 m, n = 7,7 Password: 3,1,7,2,4,8,4 out of the line numbering sequence is: 6,1,4,7,2,3 , 5.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Joseph/
Joseph/Debug/
Joseph/Debug/Joseph.exe
Joseph/Joseph.cpp
Joseph/Joseph.dsp
Joseph/Joseph.dsw
Joseph/Joseph.ncb
Joseph/Joseph.opt
Joseph/Joseph.plg
Joseph/Debug/
Joseph/Debug/Joseph.exe
Joseph/Joseph.cpp
Joseph/Joseph.dsp
Joseph/Joseph.dsw
Joseph/Joseph.ncb
Joseph/Joseph.opt
Joseph/Joseph.plg
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.