BijonDurjoy

Untitled

Oct 19th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. /// problem link - https://codeforces.com/problemset/problem/71/A
  2.  
  3.  
  4. #include<stdio.h>
  5. #include<string.h>
  6.  
  7. int main()
  8. {
  9. int n, a, i,count=0;
  10. scanf("%d", &n);
  11.  
  12. while(n--)
  13. {
  14. char s[100];
  15. scanf("%s", s);
  16. a= strlen(s);
  17.  
  18. if(a<10)
  19. {
  20. printf("%s\n", s);
  21. }
  22. else
  23. {
  24. for(i=0; i<a; i++)
  25. {
  26. if(s[i]>0 && s[i]< a-1)
  27. {
  28. count++;
  29. }
  30. printf("%s%d%s\n", s[0], count, s[a]);
  31. }
  32.  
  33. }
  34.  
  35. }
  36.  
  37. return 0;
  38. }
Add Comment
Please, Sign In to add comment