Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. //task18
  2. //public static void main(String[] args) {
  3. // Scanner sc = new Scanner(System.in);
  4. // LinkedList<String> text = new LinkedList<>();
  5. // LinkedList<String>new_text = new LinkedList<>();
  6. // while (sc.hasNextLine()) {
  7. // String line = sc.nextLine();
  8. // line = line.replaceAll("\\t", " ");
  9. // line = line.replaceAll("\\s+", " ");
  10. // line = line.trim();
  11. // line = line.replaceAll("\\s+(?=\\p{Punct})", "");
  12. // text.add(line);
  13. // }
  14. // String temp="";
  15. // for(String st:text){
  16. // st+=temp;
  17. // while (st.length()>=80){
  18. // if (st.length() == 80){
  19. // new_text.add(st.trim());
  20. // temp="";
  21. // st="";
  22. // }
  23. // else{
  24. // int index = 80;
  25. // while (st.charAt(index)!=' '){
  26. // index--;
  27. // }
  28. // String tmp = st.substring(0,index-1);
  29. // st = st.substring(index);
  30. // new_text.add(tmp.trim());
  31. // }
  32. //
  33. // }
  34. // temp = st;
  35. //
  36. // }
  37. // if (temp!=""){
  38. // new_text.add(temp);
  39. // }
  40. // for (String tmp:new_text){
  41. // System.out.println(tmp);
  42. // }
  43. //
  44. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement