当前位置: 技术问答>java相关
比较菜的问题
来源: 互联网 发布时间:2015-03-22
本文导语: 如何在终端读入一个短整形的数? | public String readConsole() throws Exception { // Create a buffered reader with System.in, then // read a line from it. BufferedReader breader;...
如何在终端读入一个短整形的数?
|
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();
}
{
// 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();
}
|
DataInputStream in = new DataInputStream(System.in);
in.readInt();
in.readInt();