導航:首頁 > 編程語言 > 字元串的組合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有哪些 瀏覽:629
回收站文件清理不在電腦上有痕跡 瀏覽:886
dx版本更新 瀏覽:738
主機集群教程 瀏覽:939
蘋果6英版好不好 瀏覽:959
nodejs抓取網站音頻 瀏覽:772
app上下載的軟體在哪裡 瀏覽:36
起凡保存的照片在哪個文件夾 瀏覽:354
數學建模如何把模型編程 瀏覽:176
ug找不到指定的許可文件 瀏覽:850
數控編程g01表示什麼 瀏覽:700
java實用類 瀏覽:190
去年做哪個網站能致富 瀏覽:727
多少的cad版本能打開pdf格式文件 瀏覽:540
win10文件比率是什麼 瀏覽:652
msdb資料庫置疑 瀏覽:210
移動花卡免流app為什麼要10元 瀏覽:147
xamppphp配置文件 瀏覽:268
刪除ghost文件 瀏覽:642
蘋果7可置換地方 瀏覽:763

友情鏈接