Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// problem link - https://codeforces.com/problemset/problem/71/A
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int n, a, i,count=0;
- scanf("%d", &n);
- while(n--)
- {
- char s[100];
- scanf("%s", s);
- a= strlen(s);
- if(a<10)
- {
- printf("%s\n", s);
- }
- else
- {
- for(i=0; i<a; i++)
- {
- if(s[i]>0 && s[i]< a-1)
- {
- count++;
- }
- printf("%s%d%s\n", s[0], count, s[a]);
- }
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment