Print an arrays by coulms
-
I need to write an arrays by coulms i have the following array
a1={1,2,3,4,5,6}
a2={7,8,9,10,11}
.
.
.
.
an={10,11,12,13,14,15}and i want to print it as
1 7 ... 10
2 8 ... 11
3 9 ... 12
4 10 ... 13
5 11 ... 14
6 12 ... 15Aren't you really really able to figure out how to accomplish such task (you know array elements may be accessed by indexes...)? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I need to write an arrays by coulms i have the following array
a1={1,2,3,4,5,6}
a2={7,8,9,10,11}
.
.
.
.
an={10,11,12,13,14,15}and i want to print it as
1 7 ... 10
2 8 ... 11
3 9 ... 12
4 10 ... 13
5 11 ... 14
6 12 ... 15Hi, what about this code? I'm supposing that you have all arrays in a list called aListOfArrays.
int iColumnCount = aListOfArrays[0].length;
for(int iCurColumn = 0; iCurColumn < iColumnCount; iCurColumn++) {
for(int iCurArray = 0; iCurArray < aListOfArrays.Count; iCurArray++) {
System.out.print(" " + aListOfArrays[iCurArray][iCurColumn].ToString());
}
System.out.println();
}Does this help you? Regards Sebastian
It's not a bug, it's a feature! Me in Softwareland.
-
Hi, what about this code? I'm supposing that you have all arrays in a list called aListOfArrays.
int iColumnCount = aListOfArrays[0].length;
for(int iCurColumn = 0; iCurColumn < iColumnCount; iCurColumn++) {
for(int iCurArray = 0; iCurArray < aListOfArrays.Count; iCurArray++) {
System.out.print(" " + aListOfArrays[iCurArray][iCurColumn].ToString());
}
System.out.println();
}Does this help you? Regards Sebastian
It's not a bug, it's a feature! Me in Softwareland.
-
Hi, what about this code? I'm supposing that you have all arrays in a list called aListOfArrays.
int iColumnCount = aListOfArrays[0].length;
for(int iCurColumn = 0; iCurColumn < iColumnCount; iCurColumn++) {
for(int iCurArray = 0; iCurArray < aListOfArrays.Count; iCurArray++) {
System.out.print(" " + aListOfArrays[iCurArray][iCurColumn].ToString());
}
System.out.println();
}Does this help you? Regards Sebastian
It's not a bug, it's a feature! Me in Softwareland.
thank you Sebastian it worked with me so good i appreciate you help. the rest of you guys , i am sorry that i am not genius as you, but i don't think there is problem to get some help with other and i guess that's the whole point of this form i know i am not professional and i didn't say that i am but i am doing my best in learning
modified on Friday, January 16, 2009 6:18 AM
-
You helped him in doing his homework. :) Now I am expecting another question for converting java into c# :-D
*jaans
Shame on me :^) I'm expecting a question like: "Now I have to add all numbers together..."
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.