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

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.