I am trying to print out all the possibilities of a given string for a fixed length 3. Here is my program
import java.util.*;
import java.lang.*;
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
String input = "abc";
int i=0,j=0,k=0;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
for(k=0;k<3;k++){
System.out.println(input.charAt(i)+input.charAt(j)+input.charAt(k));
}
}
}
}
}
But it prints the permutations of numbers in this format. But I intend to print aaa, aab, aac, bbb .. in that fashion.
291
292
293
292
293
294
293
294
295
292
293
294
293
294
295
294
295
296
293
294
295
294
295
296
295
296
297