Out:
Quote
|1|128|256|384|512|640|768|896|1024|1152|
|0|128|256|384|512|640|768|896|1024|1152|
|1|129|257|385|513|641|769|897|1025|1153|
|2|130|258|386|514|642|770|898|1026|1154|
|4|132|260|388|516|644|772|900|1028|1156|
|8|136|264|392|520|648|776|904|1032|1160|
|16|144|272|400|528|656|784|912|1040|1168|
|32|160|288|416|544|672|800|928|1056|1184|
|64|192|320|448|576|704|832|960|1088|1216|
|128|256|384|512|640|768|896|1024|1152|1280|
|0|128|256|384|512|640|768|896|1024|1152|
|1|129|257|385|513|641|769|897|1025|1153|
|2|130|258|386|514|642|770|898|1026|1154|
|4|132|260|388|516|644|772|900|1028|1156|
|8|136|264|392|520|648|776|904|1032|1160|
|16|144|272|400|528|656|784|912|1040|1168|
|32|160|288|416|544|672|800|928|1056|1184|
|64|192|320|448|576|704|832|960|1088|1216|
|128|256|384|512|640|768|896|1024|1152|1280|
Here is the code:
void rule()
{
size_row = 10; //numbers of rows ( -- )
size_col = 10; //Number or colums ( | )
pre = 0;
for( state_col=0; state_col != size_col; state_col++ ) //collum switch
{
for( state_row = 0; state_row != size_row; state_row++ ) //row switch
{
for(row = 0; row != state_row; row++)
{
if(state_col == 0 && state_row == 0)
row = 1;
else
matrix[0][0] = 1;
pre = matrix[row-1][0]+pre;
}
matrix[state_row][state_col] = pre;
}
}
}

Help



Back to top








