文件名称:Garisons-mission
介绍说明--下载内容均来自于网络,请自行研究使用
1.需求分析
本题要求循环数数,数到某一个数之后将其排除并从下一个开始重新开始数数,直到剩下一个人为止,要求剩下的人标号为1。我组有两份代码,第一个程序中,输入n值,并数的数至多为3p(p为前n个数最小公倍数,3p为了能够找到规律,n>=7时由于最小周期过大在下面的表格中不便列举),将每种可能的x,y值分组罗列出来,并试图从中找出规律,一旦规律出现,那么我们可以随意举一个符合规律的其他例子来进行验证(验证代码为另一份,而且验证的时候y不再有范围限制,只要符合规律即可)
2.概要设计
本题设计一个循环链表,用来存储n名队员的编号和存活情况(当然了,如果执行任务后安全返回就不需要继续数数了,因此执行任务即视为牺牲),两份代码中均含有两个自定义函数:
soldier *create(int n)//用于创建一个长度为n的循环链表
int judge(soldier *&head,int n)//用于观察小队中人数是否为1
第一份还含有以下两个函数:
int f(int a,int b)//为下面函数服务
int mf(int n)//用来计算前n个数最小公倍数
这两个函数用来帮助我们寻找规律
-1. After the needs analysis of this question requires loop count, count to a certain number of their exclusion and a re-start to count the start until only one person so far, the requirements for the remainder of the label 1. I have two groups of code, the first program, enter the value of n, the number and the number is up to 3p (p n is the number before the least common multiple, 3p in order to find the law, n> = 7 Because the minimum period is too large in the following table lists the inconvenience), the every possible x, y values grouping set out and tried to find out the rules, once the law is present, we are free to cite other examples of a line with the law to carry out verification (authentication code to another, and to verify the time y no limitation, so long to comply with the law) 2. outline of the design problem to design a circular linked list for storing n number of players and survival (of course, if you perform a task after the safe return of a few do not need to
本题要求循环数数,数到某一个数之后将其排除并从下一个开始重新开始数数,直到剩下一个人为止,要求剩下的人标号为1。我组有两份代码,第一个程序中,输入n值,并数的数至多为3p(p为前n个数最小公倍数,3p为了能够找到规律,n>=7时由于最小周期过大在下面的表格中不便列举),将每种可能的x,y值分组罗列出来,并试图从中找出规律,一旦规律出现,那么我们可以随意举一个符合规律的其他例子来进行验证(验证代码为另一份,而且验证的时候y不再有范围限制,只要符合规律即可)
2.概要设计
本题设计一个循环链表,用来存储n名队员的编号和存活情况(当然了,如果执行任务后安全返回就不需要继续数数了,因此执行任务即视为牺牲),两份代码中均含有两个自定义函数:
soldier *create(int n)//用于创建一个长度为n的循环链表
int judge(soldier *&head,int n)//用于观察小队中人数是否为1
第一份还含有以下两个函数:
int f(int a,int b)//为下面函数服务
int mf(int n)//用来计算前n个数最小公倍数
这两个函数用来帮助我们寻找规律
-1. After the needs analysis of this question requires loop count, count to a certain number of their exclusion and a re-start to count the start until only one person so far, the requirements for the remainder of the label 1. I have two groups of code, the first program, enter the value of n, the number and the number is up to 3p (p n is the number before the least common multiple, 3p in order to find the law, n> = 7 Because the minimum period is too large in the following table lists the inconvenience), the every possible x, y values grouping set out and tried to find out the rules, once the law is present, we are free to cite other examples of a line with the law to carry out verification (authentication code to another, and to verify the time y no limitation, so long to comply with the law) 2. outline of the design problem to design a circular linked list for storing n number of players and survival (of course, if you perform a task after the safe return of a few do not need to
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Garison's mission.cpp