Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main () {
  4.     char c8, c9,c10;
  5.     int i;
  6.     char c = getchar();
  7.     while (c != EOF) {
  8.         while (c != '<' && c != EOF) {
  9.             putchar(c);
  10.             c = getchar();
  11.         }
  12.         if (c == '<'){
  13.             putchar('<');
  14.             c = getchar();
  15.             i = 0;
  16.             while (c != '>' && c != EOF){
  17.                 i++;
  18.                 if(i <= 10) {
  19.                     if (i < 8)
  20.                         putchar(c);
  21.                     else if (i == 8)
  22.                         c8 = c;
  23.                     else if (i == 9)
  24.                         c9 = c;
  25.                     else
  26.                         c10 = c;
  27.                 }
  28.                 c = getchar();
  29.             }
  30.             if (i > 7) {
  31.                 if(i == 8)
  32.                     printf("%c",c8);
  33.                 else if(i == 9)
  34.                     printf("%c%c",c8,c9);
  35.                 else if(i == 10)
  36.                     printf("%c%c%c",c8,c9,c10);
  37.                 else
  38.                     printf("...");
  39.             }
  40.             putchar('>');
  41.         }
  42.         c = getchar();
  43.     }
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement