ImportJava.io.*;ImportJava.util.*; Public classArraySort { Public Static voidMain (string[] args) {StringBuilder sb=NewStringBuilder (); List<String> Liststr =NewArraylist<string>(); String[] Sourceword= {"This", "fat", "both", "that", "fuck", "OAW"}; String[][] Sourcestr= {"T", "H", "I", "s"}, {"W", "a", "T", "s"}, {"O", "a", "H", "G"}, {"F", "G", "D", "T"}, {"G", "O", "a", "w"}}; for(inti = 0; i < sourcestr.length; i++){ for(intj = 0; J < Sourcestr[i].length; J + +) {sb.append (sourcestr[i][j]); } String sbstr=sb.tostring (); for(intk = 0; K < Sourceword.length; k++) { if(Sb.indexof (sourceword[k])! =-1) {System.out.println (Sourceword[k]+ "at line" + (i+1) + "and Index of" + (Sb.indexof (sourceword[k)) +1)); }} sb.setlength (0); } for(inti = 0; i < sourcestr[i].length; i++) {String [] singlesourcestr=Sourcestr[i]; for(intj = 0; J < Sourcestr.length; J + +) {sb.append (sourcestr[j][i]); } String sbstr=sb.tostring (); for(intk = 0; K < Sourceword.length; k++) { if(Sb.indexof (sourceword[k])! =-1) {System.out.println (Sourceword[k]+ "at line" + (i+1) + "and Index of" + (Sb.indexof (sourceword[k)) +1)); }} sb.setlength (0); } string[] Onearray=NewString [Sourcestr.length * sourcestr[0].length]; for(inti = 0; i < sourcestr.length; i++) {String [] singlesourcestr=Sourcestr[i]; for(intj = 0; J < Singlesourcestr.length; J + +) {Onearray[i* 4 + j] =Sourcestr[i][j]; } } for(inti = 0; i < onearray.length; i++){ intStartint = i + sourcestr.length + 1; if(Startint <onearray.length) { for(intj = 0; J < Startint; J + +) { for(intK = J; K < J + (Sourcestr[0].length-(j% sourcestr[0].length)-(J/sourcestr[0].length)) * (Sourcestr[0].length + 1); K + = Sourcestr[0].length + 1) { //System.out.print (k + ",");sb.append (Onearray[k]); } liststr.add (Sb.tostring ()); Sb.setlength (0); }}} System.out.println (LISTSTR); for(inti = 0; i < sourcestr.length; i++) { for(intj = 0; J < Sourcestr[i].length; J + = 1) {System.out.print (Sourcestr[i][j]+ " "); } System.out.println (); } }}
First of all, the sense of two-dimensional array is more than one-dimensional calculation of the brain point, that three-dimensional, four-way not to mention ....