你输出c的值看看 问题在  c=System.in.read (); //输入成绩。 这行

解决方案 »

  1.   

    可以改成
    c = new Scanner(System.in).nextInt();
    或者
    c = Integer.parseInt(new BufferedReader(new InputStreamReader(
    System.in)).readLine());
      

  2.   


    将  try
      { 
              c=System.in.read (); //输入成绩。
      }
      catch(IOException e)
      {
            System.out.println (e.toString ());
      }
       换为
    Scanner sc = new Scanner(System.in);
    c = sc.nextInt();
      

  3.   

    你直接int i=test(c),把test()方法返回值类int,把static int i去掉
      

  4.   

    System.in.read();的工作就是读取输入额下一个字符的ascii码,不是你输入的数值,楼上正解
      

  5.   

    本意是想用switch()判断 test()的结果值。两个错误:1、这里test()返回类型是void,应改为 int2、同时switch(i)改为switch(test(c)),否则,i默认 初始值为0,当然永远都是E了
      

  6.   

    3楼正解,还是对控制台输入的值得获取的理解不对。
     c=System.in.read (); //输入成绩。这行不对啊