Home > Back-end >  Why can you help me take a look at this matrix back more out of the last column, how to remove the l
Why can you help me take a look at this matrix back more out of the last column, how to remove the l

Time:10-30

#include
# define NUM 6
Int main () {
Int m [NUM] [NUM];
int i;
Int j;

for (i=0; i For (j=0; J & lt; NUM. J++) {
M [I] [j]=0;
}
}
for (i=0; i For (j=0; J & lt; NUM. J++) {
If (I==j) {
M [I] [j]=1;


}
Else if (I==j + 1 | | j==I + 1) {
M [I] [j]=2;

}
Else if (I==j + 2 | | j==I + 2) {
M [I] [j]=3;
}

}
}

for (i=0; i
For (j=0; J & lt; NUM. J++) {
Printf (" % d ", m [I] [j]);
If (j==5) {
Printf (" % d \ n ", m [I] [j]);
}
}
}

return 0;
}

CodePudding user response:

If (j==5)
{
Printf (" % d \ n ", m [I] [j]);
}
Repeat print, changed to:
If (j==5)
{
printf("\n");
}
  • Related