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