把整數i轉爲String,然后用indexof~~~
這樣應該就可以了吧

解决方案 »

  1.   

    int count = 4;
    int i = 1234;
    int[] j = new int[4];
    for(int z = 0 ; z < 4 ; z ++) {
      int p = (int)Math.pow(10,count - z - 1);
      j[z] = i / p;
      i = i - j[z] * p;
    }
      

  2.   

    int i=1234;
    int t=length(Integer.toString(i));
    Vector movearray=new Vector;
    for(int p=0;p<t;p++){
    char char1=Integer.toString.charAt(p);
    movearray.addElement(char1);
    }int[] j=new int(t);
    movearray.copyInto(j);
    追后a就是您想要得!
      

  3.   

    对了
    import="java.util.*"
    这个东西的要进来!