利用toString()方法,不知道能否解决你的问题?

解决方案 »

  1.   

    还有一种很丑的方法 : 
    int i = 0;
    String str_i = i + "";
      

  2.   

    还有一个已经弃用的 方法!
      readLine();
      

  3.   

    用BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    String str=br.readLine();
    读入一个字符串,再慢慢处理不就得了?
      

  4.   

    同意楼上,System.in最好先封装一下,就像楼上的方法。