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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.