Advertisement
LEGEND2004

H

Jun 22nd, 2023
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define int long long
  5.  
  6. signed main()
  7. {
  8.     int t;
  9.     cin >> t;
  10.     while(t--){
  11.         string s;
  12.         cin >> s;
  13.         int n = s.size();
  14.         if(n <= 10){
  15.             cout << s << endl;
  16.         }else{
  17.             cout << s[0] << (n - 2) << s[n - 1] << endl;
  18.         }
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement