英文:
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.
专注分享java语言的经验与见解,让所有开发者获益!
评论