i have a program that i am doing that i have to confirme some numbers in matrices.
this is my main matrix:
coluna=0;
j=0;
SetConsoleTextAttribute( h , K+142 );
for (int i=1; i<51; i++)
{
if (n[j]==i)
{
SetConsoleTextAttribute( h , K+137 );
printf( " X");
j++;
SetConsoleTextAttribute( h , K+142 );
}
else
{
printf( " %4d", i);
}
coluna ++;
if (coluna == 6)
{
printf("\n");
coluna=0;
}
}
printf(" ");
printf("\n\n\n");
but now i have to create a matrix that will do first this see if n[j] is equal to m[j] and appear an O in the matrix place...
i allready tryed to do this:
coluna=0;
j=0;
SetConsoleTextAttribute( h , K+142 );
for (int i=1; i<51; i++)
{
if (m[j]==n[j])
{
SetConsoleTextAttribute( h , K+137 );
printf( " O");
j++;
SetConsoleTextAttribute( h , K+142 );
}
else if (n[j]==i)
{
SetConsoleTextAttribute( h , K+137 );
printf( " X");
j++;
SetConsoleTextAttribute( h , K+142 );
}
else
{
printf( " %4d", i);
}
coluna ++;
if (coluna == 6)
{
printf("\n");
coluna=0;
}
}
printf(" ");
printf("\n\n\n");
but it didnt work...it started to give me some big matrix with a lot of O... can someone help me please?
thanks