numnums= number of numbers
i = space in array
if (i == (numnums) || i == (numnums-1) )
System.out.println("");
else
System.out.printf(", ");
but this is not valid for many inputs...
This is not exactly necessary for credit, I would just like to understand the logic behind what I would like to implement D:
Of course after dinner and a glass of wine, it will come to me.
Thanks, as always for your help!
/e to give an idea:
input:
4
1 -1 01
2
output:-1, 1
input
7
1 2 3 4 5 6 7
2
output: 2, 4, 6
I just cannot seem to omit the comma on the last number, and add the new line.
This post has been edited by bradleycmetz: 24 January 2013 - 04:17 PM

New Topic/Question
Reply



MultiQuote



|