fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. String s = in.nextLine();
  11. String substr = s.substring(0, 3);
  12. String dots = "...";
  13. String ellipsis = "…";
  14. if (!substr.equals(dots) && !s.substring(0, 1).equals(ellipsis)) {
  15. s = s.replace(dots, substr);
  16. s = s.replace(ellipsis, substr);
  17. }
  18. System.out.print(s);
  19. }
  20. }
Success #stdin #stdout 0.07s 2184192KB
stdin
abc……..
stdout
abcabcabc..