Home > Mobile >  How to use the code implementation enumerates all the combination of the characters?
How to use the code implementation enumerates all the combination of the characters?

Time:11-20

How to use the code implementation enumerates all the combination of the characters?

ABCDE five characters, for example, enumerate all the length of the combination of 3

AAA
AAB
AAC
.
AAE
ABA
ABB
.
ACE
ADA
.
AED
AEE
.
EED
EEE

CodePudding user response:

This can be interpreted as hexadecimal 5, there are three so a total of 5 * 5 * 5=125 case
 
For (int I=0; i <125; + + I) {
cout (I/25 + 'A')
(I % 25/5 + 'A')
(I % 5 + 'A')
}

CodePudding user response:

ABCDE only sample, not necessarily in the actual are continuous five letters, may also be Numbers, symbols mixed,

CodePudding user response:

The
reference 1/f, dext response:
this can be interpreted as hexadecimal 5, there are three so a total of 5 * 5 * 5=125 cases
 
For (int I=0; i <125; + + I) {
cout (I/25 + 'A')
(I % 25/5 + 'A')
(I % 5 + 'A')
}


ABCDE only sample, not necessarily in the actual are continuous five letters, may also be Numbers, symbols mixed,

CodePudding user response:

Which means combination bai, you directly set of mathematical combination of bai

CodePudding user response:

https://blog.csdn.net/goldenhawking/article/details/80037669
  •  Tags:  
  • Qt
  • Related