文件名称:stacks
介绍说明--下载内容均来自于网络,请自行研究使用
Ex3.6 车皮编序问题
.问题描述:
在一个列车调度站中,1 条轨道连接到1 条侧轨处,形成1 个铁路转轨栈,如下图所示。
其中左边轨道为车皮入口,右边轨道为出口,编号为1,2,…,n 的n 个车皮从入口依次进
入转轨栈,由调度室安排车皮进出栈次序,并对车皮按其出栈次序重新编序a1, a2,., an 。
.编程任务:
给定正整数n,编程计算左边轨道车皮编号依次为1,2,…,n 时,在右边轨道最多可
以得到多少个不同的车皮编序方案。
例如当n=3 时,最多得到5 组不同的编序方案如下:
1 2 3
1 3 2
2 1 3
2 3 1
3 2 1
.数据输入:
由文件input.txt 给出输入数据。第一行有1 个正整数n,表示有n 个车皮。
.结果输出:
将计算出的所有不同的编序方案,以及不同的编序方案数输出到文件output.txt 。文件
的每行是一个编序方案。文件的最后一行是编序方案数。-Ex3.6 wagon sequence problem. Problem descr iption : In a train station, a connecting track to a side track, the formation of a railway transition stack, as shown in Fig. Which left orbit for imported cars, the right orbit for export, numbered 1, 2, ..., n n cars were imported from the stack into the transition from the dispatch room arrangements wagon Stack access priorities, as well as cars stack up according to the order re-sequence a1, a2,. , An . . Programming tasks : Given a positive integer n, the left orbital calculation programming wagon followed by No. 1, 2, ..., n, on the right track can get at the maximum number of different cars sequence program. For example, when n = 3, a maximum of five different sequence of the program are as follows : 1 2 3 1 3 2 2 1 3 2 3 1 3 2 1. Data inp
.问题描述:
在一个列车调度站中,1 条轨道连接到1 条侧轨处,形成1 个铁路转轨栈,如下图所示。
其中左边轨道为车皮入口,右边轨道为出口,编号为1,2,…,n 的n 个车皮从入口依次进
入转轨栈,由调度室安排车皮进出栈次序,并对车皮按其出栈次序重新编序a1, a2,., an 。
.编程任务:
给定正整数n,编程计算左边轨道车皮编号依次为1,2,…,n 时,在右边轨道最多可
以得到多少个不同的车皮编序方案。
例如当n=3 时,最多得到5 组不同的编序方案如下:
1 2 3
1 3 2
2 1 3
2 3 1
3 2 1
.数据输入:
由文件input.txt 给出输入数据。第一行有1 个正整数n,表示有n 个车皮。
.结果输出:
将计算出的所有不同的编序方案,以及不同的编序方案数输出到文件output.txt 。文件
的每行是一个编序方案。文件的最后一行是编序方案数。-Ex3.6 wagon sequence problem. Problem descr iption : In a train station, a connecting track to a side track, the formation of a railway transition stack, as shown in Fig. Which left orbit for imported cars, the right orbit for export, numbered 1, 2, ..., n n cars were imported from the stack into the transition from the dispatch room arrangements wagon Stack access priorities, as well as cars stack up according to the order re-sequence a1, a2,. , An . . Programming tasks : Given a positive integer n, the left orbital calculation programming wagon followed by No. 1, 2, ..., n, on the right track can get at the maximum number of different cars sequence program. For example, when n = 3, a maximum of five different sequence of the program are as follows : 1 2 3 1 3 2 2 1 3 2 3 1 3 2 1. Data inp
(系统自动生成,下载前可以参看下载内容)
下载文件列表
stacks
......\stacks.cpp
......\stacks.pdf
......\stacks.cpp
......\stacks.pdf