我是靠谱客的博主 诚心太阳,这篇文章主要介绍codeforces水题100道 第二十一题 Codeforces Beta Round #65 (Div. 2) A. Way Too Long Words (strings)...,现在分享给大家,希望可以做个参考。

题目链接:http://www.codeforces.com/problemset/problem/71/A
题意:将长字符串改成简写格式。
C++代码:

#include <string>
#include <iostream>
using namespace std;
int n;
string s;
int main()
{
    cin >> n;
    while (n --)
    {
        cin >> s;
        if (s.length() > 10)
            cout << s[0] << s.length()-2 << s[s.length()-1] << endl;
        else
            cout << s << endl;
    }
    return 0;
}
C++

 

最后

以上就是诚心太阳最近收集整理的关于codeforces水题100道 第二十一题 Codeforces Beta Round #65 (Div. 2) A. Way Too Long Words (strings)...的全部内容,更多相关codeforces水题100道内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(161)

评论列表共有 0 条评论

立即
投稿
返回
顶部