CodeForces.71A Way Too Long Words (水模拟)

CodeForces71A. Way Too Long Words (水模拟)

题意分析

题怎么说你怎么做
没有坑点

代码总览

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#define INF 0x3f3f3f3f
#define nmax 200
#define MEM(x) memset(x,0,sizeof(x))
using namespace std;
char word[nmax];
int main()
{
    //freopen("in.txt","r",stdin);
    int n;
    scanf("%d",&n);
    while(n--){
        scanf("%s",word);
        int len = strlen(word);
        if(len<=10) printf("%s
",word);
        else{
            printf("%c%d%c
",word[0],len-2,word[len-1]);
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/pengwill/p/7367100.html