http://codeforces.com/problemset/problem/71/A
生詞:
abbreviation n.縮寫(xiě)
題面:
每個(gè)string,如果length超過(guò)10就輸出第一個(gè)字符邪意,length-2声离,最后一個(gè)字符闺兢。否則原樣輸出锐想。
// codeforces
// 71A
// string
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
cin >> N;
string s;
while (N--) {
cin >> s;
int len = (int)s.length();
if (len <= 10) {
cout << s << '\n';
continue;
}
cout << *s.begin() << len - 2 << *(s.end() - 1) << '\n';
}
return 0;
}