BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int a=Integer.parseInt(br.readLine());
int a=Integer.parseInt(br.readLine());
解决方案 »
- 关于java与SQL server的一个简单的问题
- 用一个正则表达式匹配一些字符串
- 求数组下标的问题
- 给JTextArea加滚动条问题
- 一个简单的继承方法问题
- 求助用java.beans的api编写两个个map和bean互相转换的方法;object maptobean(map beanClass) map beantomap(bean)
- java调用ocx控件,提示 Class ID not found in registry result = -2147221005
- 实现双向链表,用哪个集合比较好?map?list?tree ?????????????
- 关于native2ascii方法
- 初学者的问题,java的配置和运行?
- 求教一个小问题
- 急:NIO实现的chat,客户端会滞后
BufferedInputStream is = new BufferedInputStream(System.in);
byte[] b = new byte[10];
int i = 0;
try {
int k;
for (k = 0; (b[k] = (byte)is.read()) != 13; k++)
;
i = new Integer(new String(b).substring(0, k)).intValue();
}
catch (IOException e) {
e.printStackTrace();
}
catch (NumberFormatException e) {
e.printStackTrace();
}
System.out.println(i);
}感觉有些繁琐,哪位高人给个简洁点的看看