Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int i,j,tc,length=0;
- char str[99];
- scanf("%d",&tc);
- if(tc>=1 && tc<=100)
- {
- for(j=0; j<tc; j++)
- {
- scanf("%s",str);
- length=0;
- {
- for(i=0; str[i]!='\0'; i++)
- { if (str[i] >= 'a' && str[i] <= 'z'){
- length++;}
- else{
- length=0;
- break;
- }
- }
- if(length<10 && length!=0)
- {
- printf("%s\n",str);
- }
- else if(length==0){
- printf("");
- }
- else if(length!=0)
- {
- printf("%c%d%c\n",str[0],length-2,str[length-1]);
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement