fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n;
  7. cin >> n;
  8.  
  9. while(n--) {
  10. string s;
  11. cin >> s;
  12.  
  13. int len = s.length();
  14.  
  15. if(len > 10) {
  16. cout << s[0]
  17. << len - 2
  18. << s[len - 1]
  19. << endl;
  20. } else {
  21. cout << s << endl;
  22. }
  23. }
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5296KB
stdin
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
stdout
word
l10n
i18n
p43s