登录
首页 » Windows开发 » 算法实现题2

算法实现题2

于 2022-02-12 发布 文件大小:63.87 kB
0 193
下载积分: 2 下载次数: 1

代码说明:

算法实现题2-9 排列的字典序问题 « 问题描述: n个元素{1,2, , n }有n!个不同的排列。将这n!个排列按字典序排列,并编号为0,1,…, n!-1。每个排列的编号为其字典序值。例如,当n=3时,6 个不同排列的字典序值如下: 字典序值 0 1 2 3 4 5 排列 123 132 213 231 312 321 « 编程任务: 给定n 以及n 个元素{1,2, , n }的一个排列,计算出这个排列的字典序值,以及按字 典序排列的下一个排列。 « 数据输入: 由文件input.txt提供输入数据。文件的第1 行是元素个数n。接下来的1 行是n个元素 {1,2, , n }的一个排列。 « 结果输出: 程序运行结束时,将计算出的排列的字典序值和按字典序排列的下一个排列输出到文件 output.txt中。文件的第一行是字典序值,第2行是按字典序排列的下一个排列。 输入文件示例 输出文件示例 input.txt output.txt 8 2 6 4 5 8 1 7 3 8227 2 6 4 5 8 3 1 7

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C#.NET+SQL,标准三层架构,全源码提供,代码优化,数据库设计严格。 论坛整合了一个企业版本的访问统计,大家可以访问www.asp600.com查看具...
    C#.NET+SQL,标准三层架构,全源码提供,代码优化,数据库设计严格。 论坛整合了一个企业版本的访问统计,大家可以访问www.asp600.com查看具体介绍。 项目WebClassHighlighting并没有使用,是用来代码高亮显示的,目前支持三种代码XML,VB,C#,大家自己研究吧。 关于Jmail发送大家可以看Web.config和webclassone中的类文件。 关于后台管理,其实左边的栏目是可以动态改变的,管理端没有公布,大家只要看一下数据库就知道如何使用。 接下来的时间我会公布一个代码生成器,使用项目DbClass中的类来生成应用代码,可支持生成存储过程和普通SQL语句。 关于后台版块管理里面的图片上传,这是一个公共的图片上传类,大家可仔细研究一下。-Madman forums, C
    2022-05-06 03:32:35下载
    积分:1
  • SSP从实验机!可以配置通信从平面,…
    SSP从机器实验!可以配置从机通信,朋友门可以参考一下...希望对大家有帮助!-SSP from the experimental machine! Can configure communications from the plane, friends can make reference to the door ... we want to help!
    2022-03-20 21:01:23下载
    积分:1
  • A*算法解决八数码
    题目    The 15-puzzle has been around for over 100 years; even if you don"t know it by that name, you"ve seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 frame with one tile missing. Let"s call the missing tile "x"; the object of the puzzle is to arrange the tiles so that they are ordered as:   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  x where the only legal operation is to exchange "x" with one of the tiles with which it shares an edge. As an example, the following sequence of moves solves a slightly scrambled puzzle: 
    2022-02-06 16:32:40下载
    积分:1
  • 寻找多项式的所有根
    应用背景包含了一组可用于估计所有的根(实和复)的多项式。如果找不到根,可以返回假。取决于:stddefines  ; ; ;-标准的定义和功能关键技术它使用拉盖尔方法估计根随着抛光根。一个n阶多项式有n根。如果找不到根,可以返回假。用在C中借用的代码的代码。
    2022-01-26 04:06:28下载
    积分:1
  • A simple calculator is available using this source code
    一个实现了简单计算器得程序-A simple calculator is available using this source code
    2022-11-20 07:45:03下载
    积分:1
  • mfc program design book all examples of source code. A total of 21
    mfc程序设计书中所有例子的源代码。一共21个-mfc program design book all examples of source code. A total of 21
    2022-01-26 02:13:47下载
    积分:1
  • 设计背景
    background sound for design
    2022-03-12 11:21:37下载
    积分:1
  • This is a sample LonWorks plugin application written in Visual basic.
    This a sample LonWorks plugin application written in Visual basic.-This is a sample LonWorks plugin application written in Visual basic.
    2023-06-20 02:15:03下载
    积分:1
  • 学习VCDLL示例dll_project
    学习VCDLL示例dll_project-VCDLL study sample dll_project
    2023-05-24 18:15:03下载
    积分:1
  • 独奏 ES UNA 摄影
    独奏 UNA 摄影 PROBANDO ESTO ES 段 YO PROBAR SI FUNCIONA BIEN,段 LA PROXIMO LE COLOCO PORQUE LA 想法 ES COMPARTIR DE 缔约国段 PUNTO,汶塔 CONTENIDO 联合国帕斯...ASI 科摩哟 HOY (商业理事会) 马纳纳血清 OTRO QUE BUSQUE,SI 托 FUERAMOS ASI 有关这次卢坏段 ESTA 地区。
    2023-07-27 02:30:05下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载