不要转成float了
就当作string处理吧

解决方案 »

  1.   

    这样啊  给段代码吧  
    本人刚学JAVA 菜得很
      

  2.   

    import java.io.*;public class FloatIn {
    public static void main(String[] args)throws IOException {
    BufferedReader stdin = new 
    BufferedReader(new 
    InputStreamReader(System.in));
    String s;
    int t;
    s=stdin.readLine();
    t=s.indexOf(".");
    System.out.println(
    "the integer part is: " + s.substring(0,t));
    System.out.println(
    "the decimal part is: " + s.substring(t+1));
    }
    }保险起见可以先判断是否为浮点数