题解 | #单词缩写#
单词缩写
https://www.nowcoder.com/practice/af2c953f9fc8464fa0e3252da8eb4131
#include <iostream>
#include<cstring>
using namespace std;
int main() {
int n;
cin>>n;
while(n--)
{
string s;
cin>>s;
int len = strlen(s.c_str());
if(len >= 10)
{
cout<<s[0];
cout<<len-2;
cout<<s[len-1]<<endl;
}
else
{
cout<<s<<endl;
}
}
}
// 64 位输出请用 printf("%lld")
查看17道真题和解析