Codeforces 71A Way Too Long Words Solution

Solve in C:

#include<stdio.h>
#include<string.h>
int main()
{

    char s[1001];
    int i,len,p,n,j;
    scanf("%d",&n);
    for(i=1; i<=n; i++)
    {
        scanf("%s",s);
        len=strlen(s);

        if(len>10)
            printf("%c%d%c\n",s[0],len-2,s[len-1]);
        else
            printf("%s\n",s);
    }
}

No comments

Most View Post

Recent post

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.