fork download
  1. ;/* package whatever; // don't place package name! */
  2.  
  3. /* The class name doesn't have to be Main, as long as the class is not public. */
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. java.io.BufferedReader r = new java.io.BufferedReader (new java.io.InputStreamReader (System.in));
  9. String s;
  10. s = r.readLine();
  11. //while (s != null) {
  12. while (!(s.startsWith("42"))) {
  13. System.out.println(s);
  14. s = r.readLine();
  15. }
  16. }
  17. }
Success #stdin #stdout 0.08s 212416KB
stdin
5
6
42
7
8
stdout
5
6