導航:首頁 > 編程語言 > 字元串的組合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實現相關的資料

熱點內容
app幾年出 瀏覽:698
聯想家悅er302怎麼升級 瀏覽:924
wifi怎麼傳送數據 瀏覽:134
kotlinjava混編 瀏覽:970
旅遊產業數據哪裡找 瀏覽:811
如何搭建數據分析團隊 瀏覽:293
交流電壓測量程序 瀏覽:772
debug是什麼文件夾 瀏覽:637
什麼文件是索引文件 瀏覽:466
編程中的夥伴系統是什麼意思 瀏覽:58
在哪裡上編程課好 瀏覽:251
word首頁為偶數頁 瀏覽:665
台式機清除開機密碼 瀏覽:143
巨噬細胞流式數據怎麼分析 瀏覽:681
更改默認桌面文件夾路徑 瀏覽:412
會ug編程如何開廠 瀏覽:542
怎樣刪除手機微信視頻文件在哪裡找 瀏覽:729
接收系統文件 瀏覽:252
qqjssdk只能彈窗么 瀏覽:633
linux中拷貝文件夾命令 瀏覽:784

友情鏈接