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 java.lang.Exception
  11. {
  12. Scanner x = new Scanner(System.in);
  13. for (int i = 0;i < 3;i++) {
  14. String ln = x.nextLine();
  15. System.out.println(ln.replaceFirst("(\\d+)\\s+([TWD])\\s+([\\w-]+).*", "$1_$2_$3"));
  16. }
  17. }
  18. }
Success #stdin #stdout 0.15s 321344KB
stdin
1 T table1 "a,b,c,d,e,f"
2 W table1 "a,b,c,d,e,f"
3 D table1 "a,b,c,d,e,f"
stdout
1_T_table1
2_W_table1
3_D_table1