A. Way Too Long Words
Solution :
import java.util.Scanner;
public class WayTooLongWords {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
while(test-->=0) {
String s = sc.nextLine();
if(s.length()<11) {
System.out.println(s);
} else {
String ans = ""+ s.charAt(0)+(s.length()-2)+s.charAt(s.length()-1);
System.out.println(ans);
}
}
}
}
0 comments:
Do not spam here.