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.  
  11. public static String blowup(String str) {
  12. StringBuilder sb = new StringBuilder();
  13. int repeat = 0;
  14. for (char c : str.toCharArray()) {
  15. if (Character.isDigit(c)) {
  16. repeat = repeat * 10 + Character.getNumericValue(c);
  17. } else {
  18. while (repeat > 0) {
  19. sb.append(c);
  20. repeat--;
  21. }
  22. sb.append(c);
  23. }
  24. }
  25. return sb.toString();
  26. }
  27.  
  28. public static void main (String[] args) throws java.lang.Exception
  29. {
  30. System.out.println(blowup("a3tx23z"));
  31. }
  32. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
attttxzzzzzzzzzzzzzzzzzzzzzzzz