71A. Way Too Long Words

  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4. int main()
  5. {
  6. int t;
  7. string str;
  8. int i,ln;
  9. cin>>t;
  10. for(i=0;i<t;i++)
  11. {cin>>str;
  12. ln=str.length();
  13. if(ln>10)
  14. {cout<<str.at(0)<<ln-2<<str.at(ln-1)<<endl;
  15. }
  16. else cout<<str<<endl;
  17. }
  18. return 0;

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

Aptitude test assistant programmer 2018

1041A. Heist solution