Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int i,j,tc,length=0;
  7. char str[99];
  8. scanf("%d",&tc);
  9. if(tc>=1 && tc<=100)
  10. {
  11. for(j=0; j<tc; j++)
  12. {
  13. scanf("%s",str);
  14. length=0;
  15. {
  16. for(i=0; str[i]!='\0'; i++)
  17. { if (str[i] >= 'a' && str[i] <= 'z'){
  18. length++;}
  19. else{
  20. length=0;
  21. break;
  22. }
  23. }
  24. if(length<10 && length!=0)
  25. {
  26. printf("%s\n",str);
  27. }
  28. else if(length==0){
  29. printf("");
  30. }
  31. else if(length!=0)
  32. {
  33. printf("%c%d%c\n",str[0],length-2,str[length-1]);
  34. }
  35. }
  36. }
  37. }
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement