0

So, i'm doing a program using bidimensional arrays and i'm actually using a function to print my arrays, it's not bad but i'd like another way to print them.

| 1 0 11 -2 |

| 3 7 -1 -7 |

| 0 -8 5 4 |

http://img818.imageshack.us/img818/9330/cln8.png

The problem can't really think of a way to make a for cycle that print them like that. as the just the first and last column has the char.

Please if you find a way to, use cin/cout as we've just been introduced to them.

PS. We've using C coding but with cin/cout, so no pointers ecc

Thank you for your time.

4

1 回答 1

1

您需要了解每列的宽度。然后你可以做类似的事情

cout << setw(3) << value;

从表中输出值。

于 2013-11-07T21:44:07.760 回答