fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.function.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. System.out.println(f.apply("1 11 111 "));
  11. }
  12.  
  13. static Function<String,String> f = s->{
  14. String[]l=s.split(" ",-1);s="";
  15. for(int i=2;i<17;i+=i<3?8:6){for(String n:l)s+=Integer.toString(n.length(),i)+" ";s+="\n";}
  16. return s;
  17. };
  18. }
Success #stdin #stdout 0.18s 320704KB
stdin
Standard input is empty
stdout
1 10 11 0 
1 2 3 0 
1 2 3 0