import java.io.*; // for I/O
class SomeApp
{
public static String getString() throws IOException // 接受键盘输入一个字符串
{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
return s;
}
public static void main(String[] args) throws IOException
{
String s = getString();
System.out.println(s);
}
} 程序无法运行完毕,问题出现在什么地方?在线求正解~~~感谢各位大虾!
class SomeApp
{
public static String getString() throws IOException // 接受键盘输入一个字符串
{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
return s;
}
public static void main(String[] args) throws IOException
{
String s = getString();
System.out.println(s);
}
} 程序无法运行完毕,问题出现在什么地方?在线求正解~~~感谢各位大虾!
修改成为这样就好了,其他的就不多说了import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class cc
{
public static String getString() throws IOException // 接受键盘输入一个字符串
{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
return s;
}
public static void main(String[] args) throws IOException
{
String s = getString();
System.out.println(s);
}
}
阻塞了,你的system.in 没东西过来
你需要在 console里面输入东西,然后回车 才能执行完毕
能不能说得详细点?我也调试过,确实是这里String s = br.readLine();
出现问题,但是我不知道该怎么做~~