fork download
  1. #include <bits/stdc++.h>
  2. #define ull unsigned long long
  3. #define ll long long
  4. #define el endl
  5. using namespace std;
  6. void input()
  7. {
  8. if (fopen("in.txt", "r"))
  9. {
  10. freopen("in.txt", "r", stdin);
  11. freopen("out.txt", "w", stdout);
  12. }
  13. }
  14. int main()
  15. {
  16. Fast:
  17. input();
  18.  
  19. int t;
  20. cin >> t;
  21. while (t--)
  22. {
  23. string s;
  24. cin >> s;
  25.  
  26. if (s.size() < 10)
  27. cout << s << el;
  28. else
  29. {
  30. int ctr = s.size() - 2;
  31. cout << s[0] << ctr << s[s.size() - 1] << el;
  32. }
  33. }
  34.  
  35. return 0;
  36. }
  37. /*
  38. word
  39. l10n
  40. i18n
  41. p43s
  42.  
  43. */
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout