Way Too Long Words


SUBMITTED BY: Guest

DATE: March 9, 2014, 4:29 p.m.

FORMAT: C++

SIZE: 382 Bytes

HITS: 663

  1. //Haha TTpro
  2. //Way Too Long Words
  3. #include <iostream>
  4. #include <string.h>
  5. using namespace std;
  6. int main()
  7. {
  8. char a[101];
  9. int x;
  10. int n;
  11. cin >> n;
  12. for (int i = 1; i <= n; i++)
  13. {
  14. cin >> a;
  15. x = strlen(a);
  16. if (x > 10)
  17. {
  18. cout << a[0] << x - 2 << a[x - 1] << endl;
  19. }
  20. else
  21. cout << a << endl;
  22. }
  23. }

comments powered by Disqus