Advertisement
dllbridge

Untitled

Mar 1st, 2023
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1.  
  2.  
  3. #include  <stdio.h>
  4. #include <string.h>
  5.  
  6. int                              n;
  7.  
  8. char szWord[999],
  9.      sz_ord[999];
  10. int szCipher(char *psz2, char *psz1);
  11.  
  12.  
  13.  
  14. /////////////////////////////////////////////////////////////////////
  15. int main()                                                         //
  16. {
  17.  
  18.  
  19.     scanf("%s", szWord);
  20.    
  21.     printf("%s\n", szWord);
  22.    
  23.     n = szCipher(sz_ord, szWord);
  24.  
  25.    
  26.     printf(" Len = %d, %s\n", n, sz_ord);
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. //////////////////////////////////////////////////////////////////////
  35. int szCipher(char *psz2, char *psz1)                                //
  36. {
  37.    
  38.     int nLen = strlen(psz1);
  39.     int  i = 0;
  40.     for(;i < nLen; i++)
  41.     {
  42.        
  43.         psz2[i] = psz1[i]-1;    
  44.     }
  45.    
  46.     psz2[i] = 0;
  47.    
  48. return nLen;   
  49. }
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement