Hi, I've recently started working on this programming problem and it requires one to change the size of an array.
The program has you remove all the zeroes from the sequence, as well as all the digits from the left.
Here is my code so far:
Is there any way to do this?
The program has you remove all the zeroes from the sequence, as well as all the digits from the left.
Here is my code so far:
Code:
[I]import java.util.*;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public class ACSLDigDel
{
public static void main(String[] args)
{
int n=0;
String s = JOptionPane.showInputDialog("Enter the numbers seperated by a comma:");
StringTokenizer st1 = new StringTokenizer(s, ",");
n=Integer.parseInt(st1.nextToken());
int num[]=new int[n];
for(int m=0;m<n;m++)
num[m] = Integer.parseInt(st1.nextToken());
for(int m=0;m<n;m++)
{
if(num[m]==0)
{
???
}
}
}
}[/I]
Is there any way to do this?



