Files
contests/codeforces/problemsets/wayTooLongWords/wayTooLongWords.cpp

35 lines
474 B
C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
void test_case(int tc){
string s;
cin >> s;
if(s.length() > 10){
cout << s.front() << s.length() - 2 << s.back() << '\n';
} else{
cout << s << '\n';
}
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
for(int tc = 1; tc <= t; ++tc){
test_case(tc);
}
cout << flush;
return 0;
}