解决方案 »

  1.   

    public static void main(String[] args) {
          int person=0;
          int game =0;
    try {
    Scanner in = new Scanner(System.in);
    String ss = in.nextLine();

    String[] temp = ss.split(" ");
     person = Integer.parseInt(temp[0]);
     game = Integer.parseInt(temp[1]);
    System.out.println("person :"+ person +"game "+ game);
      }catch(ArrayIndexOutOfBoundsException e) {
    System.out.println("Error of Input!");
    }
    System.out.println(game,person);
                    }这样就行了 ,作用域的问题。
      

  2.   

     System.out.println(game,person);  看看api  没有 2个 参数的。其次 ,你 game,person 也访问不到 ,变量的作用范围 不一样 。
      

  3.   

    作用域问题person,game在try以外都访问不到, 你这样写public static void main(String[] args) {   
            int person,game;
            try {   
                Scanner in = new Scanner(System.in);
                String ss = in.nextLine();
             
                String[] temp = ss.split(" ");
                person = Integer.parseInt(temp[0]);
                game = Integer.parseInt(temp[1]);
                System.out.println("person :"+ person +"game "+ game);
          }catch(ArrayIndexOutOfBoundsException e) {
                System.out.println("Error of Input!");
            }
            System.out.println(game,person);
                    }
      

  4.   

    System.out.println(game,person);
      

  5.   

    哥哥, 你的game和person定义在try里面,然后再外面使用,肯定不行啊