Saturday, May 21, 2016

CF 71A

#include<iostream>
#include<cstring>

using namespace std;

int main()
{
 int n,i,l;
 string a;
 
 while(cin>>n)
 {
  while(n--)
  {
   cin>>a;
   l=a.size();
   if(l>10)
   {
    cout<<a[0]<<(l-2)<<a[l-1]<<endl; 
   }
   else cout<<a<<endl;
   
   
  }
 }
 return 0;
}

No comments:

Post a Comment

Thank you for commenting. Please wait for response :)