Friday, March 14, 2014

Codeforces Beta Round #65 (Div. 2), problem: (A) Way Too Long Words solution

Codeforces Beta Round #65 (Div. 2), problem: (A) Way Too Long Words: http://codeforces.com/problemset/problem/71/A

Codeforces Beta Round #65 (Div. 2), problem: (A) Way Too Long Words solution: http://ideone.com/OSctau

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main() {
    int n;
    char s[105];
    scanf("%d", &n);
    while(n--) {
        scanf("%s", s);
        if(strlen(s)>10) printf("%c%d%c\n", s[0], strlen(s)-2, s[strlen(s)-1]);
        else printf("%s\n", s);
    }
    return 0;
}


No comments:

Post a Comment