0
Excuse me,could you tell me what is wrong this my program.It seems normal.Please help me,thank you!
public class cccc{ public static void array(int [][]q,int [][]w, int [][]e){ for(int i=0;i<q.length;i++){ for(int j=0;i<q[i].length;j++){ e[i][j]=q[i][j]+w[i][j];} } } public static void result(int [][]t){ for(int i=0;i<t.length;i++){ for(int j=0;i<t[i].length;j++){ System.out.print(t[i][j] + " ");} System.out.println(); } } public static void main(String[]args){ int [][]a ={ {1,2,3},{4,5,6} }; int [][]b ={ {6,3,4},{5,1,2} }; int [][]c =new int[2][3]; array(a , b , c); System.out.println("array a"); result(a); System.out.println("array b"); result(b); System.out.println("array c"); result(c); } }
2 Réponses
+ 1
My goodness😂😂😂,thank you very much!
0
Hunt
for(int j=0;i<q[i].length;j++){
should be
for(int j=0;j<q[i].length;j++){
and
for(int j=0;i<t[i].length;j++){
should be
for(int j=0;j<t[i].length;j++){