daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main()
  6. {
  7.     char a[100];
  8.  
  9.     int n, i, ln;
  10.  
  11.     scanf("%d", &n);
  12.     getchar();
  13.  
  14.     for ( i = 0; i < n; i++ ) {
  15.  
  16.         gets(a);
  17.         ln = strlen(a);
  18.         if ( ln >= 10 ) {
  19.             printf("%c%d%c", a[0], ln-2, a[ln-1]);
  20.         }
  21.         else puts(a);
  22.         printf("\n");
  23.     }
  24.  
  25.     return 0;
  26. }
RAW Paste Data
Top