打印包含不同单词的Java数组的所有组合。

huangapple 未分类评论47阅读模式
英文:

Print all combinations of java array containig different words

问题

我有一个包含以下元素的数组 = ["A","B","C"]

现在我希望输出的方式如下 -
A
B
BA
AB
AC
CA
BA
...
ABC
BCA
CAB

也就是说,我想找出所有长度的元素组合。有谁能为我提供一个相应的Java程序。提前致谢。

英文:

I have an array with following elements = ["A","B","C"]

Now I want the output to be in the following manner-
A
B
BA
AB
AC
CA
BA
...
ABC
BCA
CAB

That is I want to find all the combinations of the elements of all lengths. Could anyone suggest me a java program to do the same thing. Thanks in advance.

huangapple
  • 本文由 发表于 2020年4月7日 02:03:40
  • 转载请务必保留本文链接:https://java.coder-hub.com/61066079.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定