fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws IOException
  11. {
  12. System.out.println("key--->");
  13.  
  14. char[] ch = new char[80];
  15. int i = 0;
  16.  
  17. /*Begin*/
  18. while ((ch[i] = (char) s1.read()) != 10)
  19. i++;
  20.  
  21. // for(char a : ch )System.out.print(a);
  22.  
  23. /*output*/
  24. for (int j = 0; j < i; j++)
  25. System.out.print(" \"" + ch[j] + "\"");
  26. System.out.println("不會自動換行");
  27.  
  28.  
  29.  
  30. // System.out.println("key--->");
  31. // BufferedReader S2 = new BufferedReader(s1);
  32. // System.out.println(S2.readLine());
  33.  
  34. }
  35. }
Success #stdin #stdout 0.08s 380160KB
stdin
love




stdout
key--->
 "l" "o" "v" "e"不會自動換行