Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int n;
  8.     cin >> n;
  9.    
  10.     for (int i = 0; i < n; i++) {
  11.         string s;
  12.         cin >> s;
  13.        
  14.         if (s.size() <= 10) {
  15.             cout << s << endl;
  16.         } else {
  17.             cout << s[0] << s.size() - 2 << s[s.size() - 1] << endl;
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement