fork download
  1. import java.io.*;
  2.  
  3. /* Name of the class has to be "Main" only if the class is public. */
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String[] a = new String[3];
  9. String str;
  10.  
  11. for (int q=0; q<a.length && (str=reader.readLine())!=null; ++q) {
  12. a[q] = str;
  13. }
  14.  
  15. System.out.print(a[1]);
  16. }
  17. }
  18.  
  19.  
Success #stdin #stdout 0.1s 320320KB
stdin
Line 1
And second one
And the last
stdout
And second one