Advertisement
dllbridge

Untitled

Oct 27th, 2022
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int a,
  5.     o;
  6.    
  7. string b;
  8.  
  9. int main()
  10. {
  11.    
  12.    cin >> a;
  13.    
  14.    for(int i = 0; i < a; i++)
  15.    {
  16.        
  17.       cout << endl;
  18.       cin >> b;
  19.      
  20.       if(b.size() <= a) cout << b;
  21.        
  22.       else
  23.       {
  24.          o = b.size();
  25.          cout << b[0] << o - 2 << b[o - 1];
  26.       }
  27.      
  28.    }
  29.    
  30.    
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement