Курсовая работа: Кодирование информации Код Рида-Малера
//-----------------------------------
int edin7=0,edin8=0,edin9=0,edin10=0;
ed=0;nul=0;
int perem1[8];
perem1[0]=l1[0]+l1[8]; perem1[1]=l1[1]+l1[9];
perem1[2]=l1[2]+l1[10]; perem1[3]=l1[3]+l1[11];
perem1[4]=l1[4]+l1[12]; perem1[5]=l1[5]+l1[13];
perem1[6]=l1[6]+l1[14]; perem1[7]=l1[7]+l1[15];
for (i=0;i<4;i++)
{ if (perem1[i]==1||perem1[i]==3||perem1[i]==5||perem1[i]==7)
{ perem1[i]=1; ++ed; }
else
{ perem1[i]=0; ++nul; }
}
if (nul<ed)
{ StringGrid3->Cells[4][0]=1; edin7=6; }
else
{ StringGrid3->Cells[4][0]=0; }
//------------------------------
ed=0; nul=0;
perem1[0]=l1[0]+l1[4]; perem1[1]=l1[1]+l1[5];
perem1[2]=l1[2]+l1[6]; perem1[3]=l1[3]+l1[7];
perem1[4]=l1[8]+l1[12]; perem1[5]=l1[9]+l1[13];
perem1[6]=l1[10]+l1[14]; perem1[7]=l1[11]+l1[15];
for (i=0;i<4;i++)
{ if (perem1[i]==1||perem1[i]==3||perem1[i]==5||perem1[i]==7)
{ perem1[i]=1; ++ed; }
else
{ perem1[i]=0; ++nul; }