Codeforces-SolutionsA/Codes/71 A - Way Too Long Words/71A.cpp

17 lines
249 B
C++
Raw Normal View History

2023-06-07 22:15:42 +08:00
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,len;
string s;
cin>>t;
while(t--)
{
cin>>s;
len=s.size();
if(len>10) cout<<s[0]<<len-2<<s[len-1]<<endl;
else cout<<s<<endl;
}
}