import java.io.*;
public class Main {
public static void main (String[] args) throws IOException {
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
String line;
StringBuffer out=new StringBuffer();
while ((line = buffer.readLine()) != null) {
line = line.trim();
if(line.length()>55){
if(line.charAt(39)==' '){
out.append(line.substring(0, 39));
}
else{
boolean flag=true;
for(int i=39;i>0;i--){
if(line.charAt(i)==' '){
out.append(line.substring(0, i));
flag=false;
break;
}
}
if(flag){
out.append(line.substring(0, 40));
}
}
out.append("... <Read More>");
}else{
out.append(line);
}
out.append("\n");
}
System.out.print(out);
}
}
public class Main {
public static void main (String[] args) throws IOException {
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
String line;
StringBuffer out=new StringBuffer();
while ((line = buffer.readLine()) != null) {
line = line.trim();
if(line.length()>55){
if(line.charAt(39)==' '){
out.append(line.substring(0, 39));
}
else{
boolean flag=true;
for(int i=39;i>0;i--){
if(line.charAt(i)==' '){
out.append(line.substring(0, i));
flag=false;
break;
}
}
if(flag){
out.append(line.substring(0, 40));
}
}
out.append("... <Read More>");
}else{
out.append(line);
}
out.append("\n");
}
System.out.print(out);
}
}
No comments:
Post a Comment