HI,
suppose i have given input numbers 开发者_如何学JAVAlike this 1,2,3,4,5,6,7,8,9,0
i should form it as 3 x 3 matrix but my input has 10 elements how to form a matrix for such input in c#
try this
int[] arr = new int[3 + 1/3, 3]
How do you fit ten elements into nine variables? You don't.
You're asking an impossible question. I'm sure someone will come up with some absurd hack that lets you do this, but that doesn't make it sensible to store data this way.
Use a larger array, or store fewer values.
精彩评论