ok so I have a bunch of numbers like this...
1421
40104
321
32
etc
how do I put them in an array and shift it to the right side of the array so it looks like this:
00000000001421
00000000040104
etc
the length of the whole array is 25. so if there are 4 digits in the input number, there should be 21 zeros in front of it.
they need to add up correctly when done the math.
so far I got int[] total = new int[25]
i was thinking of setting the array to 25 blocks and making a for-loop so that I can add zeros in front of the numbers until the 'total.length' of array reaches 25
so maybe it should start out with something like:
for (int i = 0; i < 25; i++) {
but I only have the idea down, I have no idea how I should write this out in java programming language.
thanks for any help.
1421
40104
321
32
etc
how do I put them in an array and shift it to the right side of the array so it looks like this:
00000000001421
00000000040104
etc
the length of the whole array is 25. so if there are 4 digits in the input number, there should be 21 zeros in front of it.
they need to add up correctly when done the math.
so far I got int[] total = new int[25]
i was thinking of setting the array to 25 blocks and making a for-loop so that I can add zeros in front of the numbers until the 'total.length' of array reaches 25
so maybe it should start out with something like:
for (int i = 0; i < 25; i++) {
but I only have the idea down, I have no idea how I should write this out in java programming language.
thanks for any help.