1. 程式人生 > >Codeforces 71A Way Too Long Words

Codeforces 71A Way Too Long Words

div problems 題目 space ostream mes -- AS bsp

技術分享圖片

題目鏈接

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

Codeforces 71A Way Too Long Words