2020-12-31

Java. Formatting array

My problem is this: i have 2d array which is filled with numbers. I have to output it in a way that it shows "*" between neighbours with different values and with " " if values are different. Example:

   *********
   *1 1*3*4*
   ***** * *
   *2 2*3*4*
   *********

I have tried many things like creating another array with [Nx2][Mx2] size or System.out.format but it in the end its never formatte the way I like. Any suggestions how can I solve this?



from Recent Questions - Stack Overflow https://ift.tt/380qo70
https://ift.tt/eA8V8J

No comments:

Post a Comment