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