0
如果我有 'A', 'B', 'C' 的概率为:概率级联字符?
**
abc
acb
bac
bca
cab
cba
**
BufferedReader input = new BufferedReader(new FileReader("input.in"));
int x = Integer.parseInt(input.readLine()) ;
String [] ar = new String[x] ;
String output = "";
for(int i =0 ; i< ar.length ; i++)
{
ar[i] = input.readLine() ;
}
for(int y = 0 ; y < ar.length ; y++)
{
for(int z =y ; z < ar.length ; z++){
output = output.concat(ar[z]) ;
}
}
System.out.println(output);
也许更多反正我怎么能编码呢?
阅读排列/组合。 –
这是什么问题?我不明白这件事。 – SudoRahul
由*“概率是”*,你可能意味着*排列是*? – hyde