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;
}

 

posted @ 2018-06-17 12:16  CMlhc  阅读(141)  评论(0编辑  收藏  举报