ممكن مساعده
اريد ضرب مصفوفتين كل منها احاديه و أخزن ناتج ضربهم في مصفوفه ذات بعدين
و بعد ذلك ايجاد جمع كل قطر في الصفوفه الثنائيه
انا حاولت في لكن ظهر عندي خطأ في ناتج ضرب المصفوتين
و كيف ممكن أجد جمع كل قطر في الصفوفه الثنائيه
هاي الكود و محاولتي
import javax.swing.*;
public class sumarray {
public static void main( String args[] )
{
int array1[] = { 1, 2 };
int array2[] = { 1, 2 , 3};
int array3[][] ={ {0,0,0} ,{0,0,0} , {0,0,0} } ;
int total = 0;
// multiplcation and store in array3[][]
for ( int i = 0; i < array1.length; i++ )
for ( int j = 0; j < array2.length; j++ ){
array3[j]+= array1*array2[j];
}
JOptionPane.showMessageDialog( null,
"the multiplcation of array " + array3,
" ",
JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
}
}

