With 26 lowercase and 10 Numbers 4, how to print the combination of each group (bosses first aid interview questions)
CodePudding user response:
4 a for loop
CodePudding user response:
Using a recursive is simpler, give you a small example
static String [] CHAR=new String [] {" a ", "b", "c", "d", "e", "f", "g", "h", "I", "j"};
Public static void print (String STR) {
If (STR) length ()==4) {
System. The out. Println (STR);
return;
}
For (String s: CHAR) {
Print (STR + s);
}
}
Public static void main (String [] args) {
Print (" ");
}
CodePudding user response:
This thing will write, mainly put each group of four, printed in each group
CodePudding user response: