登录
首页 » 算法 » 最小不重复数问题

最小不重复数问题

于 2022-05-13 发布 文件大小:107.63 kB
0 155
下载积分: 2 下载次数: 1

代码说明:

问题描述:给定一个数n,找出大于这个数的最小不重复数(任意相邻位数字不相同)。 程序给出了两种方法:find和find1,其中find1属于暴力法,直接从n+1开始寻找,每次加1,知道找到满足条件的不重复数为止。 第二种方法比较巧妙,将n各位数字存到一个数组a[]里,下标大小对应位数高低,比如1234,数组a[0...3]依次为1,2,3,4;从最高位开始找相邻的重复数,较低的重复位加1带进位,高位循环加进位直到无进位,低位置零;回到次高位重新寻找重复位,直到无重复位。

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

发表评论

0 个回复

  • With c++ Prepared Romberg integration process with examples and calculation resu...
    用c++编写的龙贝格积分的程序 附有实例和计算结果-With c++ Prepared Romberg integration process with examples and calculation results
    2022-02-07 07:17:57下载
    积分:1
  • hsjgvdshjdvshvssssdjvs
    sjdhgsssssss js dhs shdghs hsaj hsds hsdgas d asd asd asf sd xc zxc zxc zxc zxcz xvc zxc zc zc zc zc zc zxc zxc zc zxc zc zc zc zc zc zc zc zc zc zd sdhjsdsdss dsdscf sfxzvc xvx v xcxcz xcs ad zxvx ssda asfsd sfa sfsa xzcx sfsfsf s fasnfb;
    2022-01-31 12:33:55下载
    积分:1
  • 穿虎可惜TERA
    应用背景sdsdfasfafad fhshsfhsfhdfhsfhsfhh gasdgsdfsfhsfhs  ; ; ;sfhsfghsfgh  ;sfghsfghsfhsfhgdfhsfhsfhh sfghsfhsfghsfh  ; ; ;sfghsfhsfghsfh sfhsfghsfgh  ; ;sfghsfghsfhsfhg关键技术xfgnnxnnxfgnnxnnxfgn nxnnxfgnnxnnxfgnnxnnxfgnnxnnxfgn xnnxfgnnxnnxfgnnxnnxfgnnxnnxfgnnxnnxf gnnxnnxfgnnxnn  ;xfgnnxnnxfgnnxnn
    2023-04-15 23:55:03下载
    积分:1
  • OFELI is an object oriented library of C++ classes for development of finite ele...
    OFELI is an object oriented library of C++ classes for development of finite element codes. Its main features are : * Various storage schemes of matrices (dense, sparse, skyline). * Direct methods of solution of linear systems of equations as well as various combinations of iterative solvers and preconditioners. * Shape functions of most "popular" finite elements * Element arrays of most popular problems (Heat Transfer, Fluid Flow, Solid Mechanics, Electromagnetics, ...).-OFELI is an object oriented library of C++ classes for development of finite element codes. Its main features are :* Various storage schemes of matrices (dense, sparse, skyline).* Direct methods of solution of linear systems of equations as well as various combinations of iterative solvers and preconditioners.* Shape functions of most "popular" finite elements* Element arrays of most popular problems (Heat Transfer, Fluid Flow, Solid Mechanics, Electromagnetics, ...).
    2022-02-27 06:26:31下载
    积分:1
  • 求交换变量值的代码:要求编写一个函数实现两个整型变量交换彼此的数值。...
    求交换变量值的代码:要求编写一个函数实现两个整型变量交换彼此的数值。
    2022-04-06 14:11:49下载
    积分:1
  • GCV Generalized cross
    GCV Generalized cross-validation.广义交叉校验,用做非线性时间序列的计算,非常有用,找了好久才找到的。不要错过机会哦-GCV Generalized cross-validation. Generalized cross-validation, using nonlinear time series to do the calculation, is very useful to find for a long time to find the. Oh, do not miss the opportunity to
    2023-06-11 07:15:03下载
    积分:1
  • c_meanc语言实现
    c_mean算法是一种非监督的模式识别算法,不需要进行样本训练,通过计算样本距离,进行比较分类。算法结构简单,对于团状数据分类效果理想。
    2022-02-18 15:40:35下载
    积分:1
  • 奇异分解,针对不能求逆的情况下,才用svd方就能够解方程...
    奇异分解,针对不能求逆的情况下,才用svd方法就能够解方程-Singular decomposition, for the case of inversion should not only be able to use SVD approach equation solution
    2022-03-02 18:40:59下载
    积分:1
  • 统计方面的程序,c编译
    统计方面的程序,c编译-statistical procedures, c compiler
    2022-07-28 07:07:12下载
    积分:1
  • 2022-06-30 06:05:11下载
    积分:1
  • 696518资源总数
  • 106215会员总数
  • 5今日下载