分类: Java
2010-03-01 16:19:12
chinaunix网友2010-03-01 16:23:51
System.out.println("请输入第"+(i+1)+"整数:"); try{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); a[i]=Integer.parseInt(br.readLine()); } catch(Exception e){ System.out.println("请输入整数");break; } } 而一下代码是错误的: System.out.println("请输入第"+(i+1)+"整数:"); try{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); a[i]=br.Read(); } catch(Exception e){ System.out.println("请输入整数")