number=System.in.read();可能是类型转换问题。
进行一下转换number=(Iteger)System.in.read();
试试看,我记不得了。

解决方案 »

  1.   

    import java.io.*;public static void main (String[] args)
    {
    byte b[] = new byte[8];
     String name="sample";
     int number=0;
     float =0;
                       BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
            
     
    try
    {
        System.out.println("请输入姓名");
        System.out.flush();
                                    
                                    
        name = br.readLine();
        System.out.println("请输入学号");
                                   System.out.flush();
        number=new Integer(br.readLine());
        System.out.println("请输入分数");
                                   System.out.flush();
        =new Integer(br.readLine());
    }
    catch(IOException e)
    {
    System.out.println(e.toString());
    }

    System.out.println(name+number+);
    }
      

  2.   

    public String readConsole() throws Exception 
       {
          // Create a buffered reader with System.in, then
          // read a line from it.
          BufferedReader breader;
          breader = new BufferedReader(new InputStreamReader(System.in));
          return breader.readLine();
       }
      

  3.   

    sorry,前面将错了。
    number=System.in.read();
    你读取的是ascii码,你会不会将ascii转换成char?还有你这样转换太麻烦,倒不如象name一样先用byte读入在转换。
      

  4.   

    number=new Integer(br.readLine());
    如果不行就用下面的方法(反正我是不行所以才改的):
    number=Integer.valueOf(br.readLine()).intValue() ;
      

  5.   

    因为是float类型,用System.out打印float数值到console上,是有小数部分的。如果你想打出的结果和输入一样的话,就别用float。
      

  6.   

    amartapple ,你的程序有问题。public static void main (String[] args)
    {
    byte b[] = new byte[8];
     String name="sample";
     int number=0;
     float =0;
            
     
    try
    {
        System.out.println("请输入姓名");
        System.in.read(b); // 这里的长度规定为 8 个字节,也就是说如果你的名字超过8个英文字,4个中文字,就会被认为是下个读入的字符。
    // 这里你认为结束的回车换行也回被计算为下一个int
        name = new String(b);
        System.out.println("请输入学号");
        number=System.in.read(); // 你的学号只可以有一个字符的长度。
        System.out.println("请输入分数");
        =System.in.read(); // int 型强转换为float型。如你看到的是1就会变成49.00,2->50.00,etc....
    }
    catch(IOException e)
    {
    System.out.println(e.toString());
    }

    System.out.println(name+number+);
    }
    你说你的分数是5757.0
    我猜你的学号中的一二位是9吧。