CodeForces 71 A.Way Too Long Words(水~)
2017-09-01 22:45
387 查看
Description
给出一个字符串,串长不超过10则直接输出,如果超过10就只输出首字母+中间字符个数+尾字母
Input
第一行一整数T表示用例组数,每组用例输入一个字符串s(1≤T,|s|≤100)
Output
输出处理后的字符串
Sample Input
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
Sample Output
word
l10n
i18n
p43s
Solution
水题
Code
给出一个字符串,串长不超过10则直接输出,如果超过10就只输出首字母+中间字符个数+尾字母
Input
第一行一整数T表示用例组数,每组用例输入一个字符串s(1≤T,|s|≤100)
Output
输出处理后的字符串
Sample Input
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
Sample Output
word
l10n
i18n
p43s
Solution
水题
Code
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> #include<map> #include<set> #include<ctime> using namespace std; typedef long long ll; typedef pair<int,int>P; const int INF=0x3f3f3f3f,maxn=100001; char s[maxn]; int main() { int T; scanf("%d",&T); while(T--) { scanf("%s",s); int len=strlen(s); if(len<=10)printf("%s\n",s); else printf("%c%d%c\n",s[0],len-2,s[len-1]); } return 0; }
相关文章推荐
- CodeForces 71A Way Too Long Words
- codeforces 71A Way Too Long Words(水题)
- 【CodeForces】A. Way Too Long Words
- codeforces Way Too Long Words
- Way Too Long Words_Codeforces_71A
- codeforces 71A - Way Too Long Words
- Problem--71A--Codeforces--Way Too Long Words
- Way Too Long Words_Codeforces
- codeforces水题100道 第二十一题 Codeforces Beta Round #65 (Div. 2) A. Way Too Long Words (strings)
- CodeForces-71A-Way Too Long Words
- 【String】#65 A. Way Too Long Words
- 71A - Way Too Long Words
- 71A. Way Too Long Words
- coderforces Way Too Long Words
- A. Way Too Long Words
- CF:71A.Way Too Long Words
- Way Too Long Words
- cf水题:71A - Way Too Long Words
- 71A_Way Too Long Words
- 71A Way Too Long Words