forked from abheekd/usaco-practice
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
360 B
22 lines
360 B
3 years ago
|
using namespace std;
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <string.h>
|
||
|
|
||
|
int main() {
|
||
|
int n;
|
||
|
cin >> n;
|
||
|
for (int i = 0; i < n; i++) {
|
||
|
string s;
|
||
|
cin >> s;
|
||
|
int length = s.length();
|
||
|
char first = s.front();
|
||
|
char last = s.back();
|
||
|
if (length > 10) {
|
||
|
cout << first << length << last << endl;
|
||
|
} else {
|
||
|
cout << s << endl;
|
||
|
}
|
||
|
}
|
||
|
}
|