A. Way Too Long Words(无思维纯模拟)

简介: A. Way Too Long Words(无思维纯模拟)

题目链接

Problem - A - Codeforces


一些话


流程

无思维简单模拟题,所有步骤都可以简单地实现

长度超过十的字符串只输出首+长度-2+尾

不超过十的字符串直接输出

套路

字符串未给长度,但要用长度:

使用.size()获取长度,最好储存在变量里方便使用


ac代码

#include <iostream>
using namespace std;
int main(){
    int t;
    cin >> t;
    while(t--){
        string s;
        cin >> s;
        if(s.size() > 10){
            cout << s[0] << s.size() - 2 << s[s.size()-1] << endl;
        }
        else cout << s << endl;
    }
    return 0;
}
目录
相关文章
|
5月前
|
分布式计算 DataWorks 监控
DataWorks操作报错合集之遇到“OSERROR: argument list too long”的错误,该如何处理
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
63 1
|
6月前
|
Java
Intellij IDEA运行报Command line is too long的解决办法
Intellij IDEA运行报Command line is too long的解决办法
374 1
|
Java
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
186 0
|
6月前
四种解决”Arg list too long”参数列表过长的办法
这些方法都可以帮助你避免因参数列表过长而导致的错误。选择方法取决于具体情况和需求。
251 0
|
Java 开发工具 git
解决Error running XXXApplicationCommand line is too long.报错
解决Error running XXXApplicationCommand line is too long.报错
|
Java Spring
Command line is too long. Shorten command line for Application or also for Spring Boot default confi
Command line is too long. Shorten command line for Application or also for Spring Boot default confi
39 1
|
Java
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
83 0
|
Java
【异常】SpringBoot报错Command line is too long.Shorten command line for Application or also for Applicatio
【异常】SpringBoot报错Command line is too long.Shorten command line for Application or also for Applicatio
527 0
|
机器学习/深度学习
CF71A Way Too Long Words(string简单模拟)
CF71A Way Too Long Words(string简单模拟)
64 0
|
Java
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
366 0