Advertisement
Guest User

B

a guest
Sep 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1.     #define _CRT_SECURE_NO_WARNINGS
  2.      
  3.     #include <iostream>
  4.     #include <algorithm>
  5.     #include <cmath>
  6.     #include <string>
  7.     #include <vector>
  8.     #include <map>
  9.     #include <set>
  10.     #include <queue>
  11.     #include <assert.h>
  12.      
  13.     using namespace std;
  14.      
  15.     #define ll long long
  16.     #define ull unsigned long long
  17.     const ll INF = 1e18;
  18.     const double PI = acos(-1.0);
  19.      
  20.      
  21.      
  22.     int main()
  23.     {
  24.         //freopen("INPUT.TXT", "r", stdin);
  25.         //freopen("OUTPUT.TXT", "w", stdout);
  26.         ios::sync_with_stdio(false);
  27.      
  28.         int m;
  29.         cin >> m;
  30.         for (int i = 0; i < m; i++)
  31.         {
  32.             string s;
  33.             cin >> s;
  34.             int n = s.size();
  35.      
  36.             if (n <= 10)
  37.             {
  38.                 cout << s << endl;
  39.             }
  40.             else
  41.             {
  42.                 cout << s[0] << n - 2 << s[n - 1] << endl;
  43.             }
  44.         }
  45.      
  46.         //system("pause");
  47.         return 0;
  48.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement