الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشروع تخرج

بدأه .Software Eng في 12 فبراير 2013 · 1 رد · 994 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم هذا الكود الذي قمتوا بكتابته ........انا فقط احتاج الى كيفية ضرب كل صف بعمود بحيث لو كان الindex للصف مثلا صفر يجب ضربه بالعمود صفر اي نفس الاندكس,لكن انا حاولت لكن ما كدرت,فطبقت الضرب العادي عالمصفوفة ,,,,اتمنى مساعدتي....(هذه خوارزمية SUMMA).......شكرا

 
 
 
 

 

package dd2;public class dividemulty {/*** @param args*/public static void main(String[] args) {// TODO Auto-generated method stub                  int s[][]={{1,2,3,4, 1,2,3,4, 1,2,3,4},                     {1,2,3,4, 1,2,3,4, 1,2,3,4},                             {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4},   {1,2,3,4, 1,2,3,4, 1,2,3,4}};int s1[][]=new int[12][12],k2=0,nn=0, x[][]=new int[12][12],A[][]=new int[12][12] ,B[][]=new int[12][12],ss[][]=new int[12][12],i=0,m=0,n=0,j=0,kk=0,k=10,k1=0;               /*for(i=0;i<12;i++)           for(j=0;j<12;j++)                 s[j]=k++;*/ //print the original array:     System.out.print("the original array s");       System.out.println();     for(i=0;i<12;i++)        { for (j = 0; j < 12; j++)              { System.out.print(s[j]);                System.out.print(' ' ); }              System.out.println();        }             System.out.println();         //The process :        for(i=0;i<12;i+=2)           {n=0;                for (j = 0; j < 12; j += 3)                   { x[m][n++]=s[j];}                //System.out.println(x[m][n++]);                                for (j = 0; j < 12; j += 3)                   { x[m][n++]=s[j+1]; }                for (j = 0; j < 12; j += 3)                     {x[m][n++]=s[j+2];}                        m++;                          }                for(i=1;i<12;i+=2)           {n=0;                for (j = 0; j < 12; j += 3)                   { x[m][n++]=s[j]; }                                                     for (j = 0; j < 12; j += 3)                   { x[m][n++]=s[j+1]; }                for (j = 0; j < 12; j += 3)                     {x[m][n++]=s[j+2];}                m++;           }    //create tow copy A & B , from the result array x :    A=B=x;//print the Result:    System.out.print("the final array 'A'");    System.out.println();        for(i=0;i<12;i++)        {            for (j = 0; j < 12; j++)              { System.out.print(A[j]);                System.out.print(' ' );  }           System.out.println();        }                System.out.println();                System.out.print("the final array 'B'");        System.out.println();        for(i=0;i<12;i++)        {            for (j = 0; j < 12; j++)              { System.out.print(B[j]);                System.out.print(' ' );  }              System.out.println();        }            //divide//    System.out.println();for(i=0;i<12;i+=2)  { for (j = 0; j < 12; j += 3)       {         System.out.print(s[j]+" ");          }   //System.out.print(s[j+1]+" ");   System.out.println();     //System.out.print(s[j+1]);}///////////////System.out.println();for(i=0;i<12;i+=2){ for (j = 0; j < 12; j += 3)   { System.out.print(s[j+1]+" "); }//System.out.print(s[j+1]+" "); System.out.println();//System.out.print(s[j+1]);}System.out.println();for(i=0;i<12;i+=2){ for (j = 0; j < 12; j += 3)   { System.out.print(s[j+2]+" "); }//System.out.print(s[j+1]+" "); System.out.println();//System.out.print(s[j+1]);}System.out.println();for(i=1;i<12;i+=2) { for (j = 0; j < 12; j += 3)      {       System.out.print(s[j]+" ");        }  //System.out.print(s[j+1]+" "); System.out.println();    //System.out.print(s[j+1]);}///////////////System.out.println();for(i=1;i<12;i+=2){ for (j = 0; j < 12; j += 3)  { System.out.print(s[j+1]+" ");}//System.out.print(s[j+1]+" "); System.out.println();//System.out.print(s[j+1]);}System.out.println();for(i=1;i<12;i+=2){ for (j = 0; j < 12; j += 3)  { System.out.print(s[j+2]+" ");}//System.out.print(s[j+1]+" "); System.out.println();//System.out.print(s[j+1]);}  //////////////multiply the parts    for(i=0;i<12;i++)       {            for (j = 0; j < 12; j++)            {                   for( k1 = 0; k1 <12; k1++){                      s1[j]+=A[k1]*B[k1][j];                    }}}    /////////////////        System.out.println();                                   System.out.print("the multiply new array");              System.out.println();                  for(i=0;i<12;i++)                   {                      for (j = 0; j < 12; j++)                        { System.out.print(s1[j]);                          System.out.print(' ' );  }                     System.out.println();                  }

 

}}
 
 
 
#2

أعتقد أن الأمر ليس ضرب بالطريقة العاديه ...

لأنه فيما يبدو يوجد مجموعة من الخوارزميات في هذا المجال...

أعتقد أن هذه الورقة ممكن أن تساعدك

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.111.5176&rep=rep1&type=pdf

تم تعديل هذه المشاركة بواسطة mhewedy في 16 فبراير 2013 في 16:13

مواضيع مشابهة