Codeforces 71A Way Too Long Words
题目链接
http://codeforces.com/problemset/problem/71/A
#include<iostream> #include<string> using namespace std; int main() { int n; cin>>n; while(n--) { string str; cin>>str; int len=str.length(); if(len<=10) { cout<<str<<endl; }else { len=len-2; cout<<str[0]<<len<<str[len+1]<<endl; } } return 0; }