Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<iostream>
#include<string>
using namespace std;
int main(){
int t;
cin>>t;
string s[t];
for(int i = 0; i <t; i++){
cin>>s[i];
}
for(int i = 0; i < t; i++){
if(s[i].size() > 10){
cout<<s[i][0]<<s[i].size()-2<<s[i][s[i].size()-1]<<endl;
}
else{
cout<<s[i]<<endl;
}
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
Output
word
l10n
i18n
p43s
l10n
i18n
p43s
Demonstration
Codeforcess Solution 71-A A. Way Too Long Words ,C++, Java, Js and Python ,71-A,Codeforcess Solution