Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0000000000000000000000203
- 0000000000000000000000045
- 0000000000000000000000010
- 0000000000000000000000258
- //Every array will be 25 digits long. Mostly zeroes with the numbers to add at the
- //end
- public static final int ARRSIZE = 25;
- public static void addStuff(String[] stuff) {
- String[] result = new String[ARRSIZE];
- int[] holder = new int[ARRSIZE];
- String temp = "";
- int area = 0;
- int carry = 0;
- for(int i = 0; i < stuff.length; i++)
- {
- for(int j = 0; j < stuff.length; j++)
- {
- temp = stuff[j].substring(stuff[i].length() - 1-i, stuff[i].length()-i);
- area += Integer.parseInt(temp);
- if(area >= 10)
- {
- carry = area/10;
- holder[ARRSIZE - 1-i] = area%10;
- area = 0;
- }
- carry = 0;
- }
- }
- //TODO: Make int[] holder -> String[] result
- //Take result String[] to future method
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement