Getting STDIN in eclipse?

I need to write competition code using STDIN and STDOUT, how can I configure eclipse to enter data from STDIN ??

When I just used the editor and command line, I ran:

java Hatch < hatch_input

Now I need an equivalent to work directly from eclipse. It would be ideal if I could use it directly from a file, but it would be enough just to insert the actual input somewhere, while I can write code that accepts STDIN directly in eclipse by pressing the RUN button.

class Main{

       public static void main (String[] args) throws java.lang.Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    }

}

Above code is what I'm trying to achieve.

+4
source share
3 answers

. " ..."

Java. "" , .

: "" , *.launch, . .

+4

. Sdtin, , .

+4
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
-2
source

All Articles