static void Main(string[] args)
        {
            string str2 = "";
            Method("1234", str2);
            Console.WriteLine(counter);
            Console.ReadKey();
        }

        static void Method(string str,string str2)
        {
            if (str == null)
                return;

            if (str == string.Empty)
            {
               Console.WriteLine(str2);
               counter++;
              
            }

            for (int i = 0; i < str.Length; i++)
            {
                Method(str.Remove(i, 1), str2+str[i].ToString());
            }
        }

输出一个字符串的所有排列组合,有重复字符

相关文章:

  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-01-08
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2022-01-26
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案