Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2.   #include <ctype.h>
  3.   #include <malloc.h>
  4.   #define lim 101
  5.  
  6. int main()
  7.   {
  8.  
  9.       int i;
  10.       char c,A[lim];
  11.        
  12.      
  13.  
  14.       i = 0;
  15.       while (i < lim-1) {
  16.           c = getchar();
  17.           if (c == EOF)
  18.               break;
  19.           if (c == '\n')
  20.               break;
  21.           if(isdigit(c)){
  22.           c = c -'0';
  23.           c = 9 - c;
  24.           c = c + '0';
  25.           }
  26.           A[i++] = c;
  27.       }
  28.       A[i] = '\0';
  29.  
  30.  
  31.       printf("%s", A);
  32.  
  33.       return 0;
  34.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement