導航:首頁 > 編程語言 > 字元串的組合java實現

字元串的組合java實現

發布時間:2024-12-02 18:15:30

java怎麼把2個字元串拼接在一起

差距很大
GTX1060撐死也就GTX980的性能
RX 480和頂級非公GTX970差不多
而GTX1070比GTX980TI還強一點
二者差距百分之40

② java 列出一個字元串的全字元組合情況,不考慮重復字元

package;

importjava.util.Arrays;
importjava.util.LinkedList;

publicclassRecursionSub3Sort
{
staticintcount=0;
staticchar[]array={'a','b','c'};
staticLinkedList<char[]>list=newLinkedList<char[]>();
staticint[]indexs=newint[3];
staticintlen=array.length;

publicstaticvoidmain(String[]args)
{
getSub();
for(char[]cs:list)
{
System.out.println(Arrays.toString(cs));
}
}

privatestaticLinkedList<char[]>getSub()
{
while(count<=len)
{
recursionSub(0,-1);
count++;
}
returnlist;
}

privatestaticLinkedList<char[]>recursionSub(intind,intstart)
{
start++;
if(start>count-1)
{
returnnull;
}
for(indexs[start]=0;indexs[start]<len;indexs[start]++)
{
recursionSub(0,start);
if(start==count-1)
{
char[]temp=newchar[count];
for(inti=count-1;i>=0;i--)
{
temp[start-i]=array[indexs[start-i]];
}
if(temp.length==1
||Arrays.toString(temp).replaceAll("[\[\]\s,]","").replaceAll("(\w)\1+","$1")
.length()!=1)
{
list.add(temp);
}
}
}
returnlist;
}
}

閱讀全文

與字元串的組合java實現相關的資料

熱點內容
怎麼把跳舞視頻弄進文件夾 瀏覽:173
音樂app哪些是騰訊的 瀏覽:626
qq惡搞暴走圖片製作 瀏覽:347
相對坐標編程有什麼特點和好處 瀏覽:785
網站反爬取怎麼辦 瀏覽:59
網路愛好者 瀏覽:259
電信卡登陸什麼app 瀏覽:625
中文數據怎麼導入matlab 瀏覽:667
6賺錢app有哪些 瀏覽:726
數控編程語句case是什麼意思 瀏覽:364
cad文件打開突然關了 瀏覽:993
怎麼將文件名復制到粘貼板 瀏覽:220
什麼網站看港漫好用 瀏覽:618
照相機視頻的文件夾 瀏覽:205
照片怎樣用cad轉成cad文件 瀏覽:822
有兩個網站如何操作 瀏覽:499
excel怎麼把兩個表格中的數據導入 瀏覽:530
什麼是一二一二三APP 瀏覽:877
cs6的魔棒工具 瀏覽:243
文件夾變成受系統保護 瀏覽:479

友情鏈接