elifx

Untitled

Sep 15th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <math.h>
  5. #define N 80//delete
  6.  
  7. int  decrypt(char[]);
  8.  
  9. void main()
  10. {
  11.     int r;
  12.     char *s, crypto[] ="Btwlzx Dqqes Eq|pj2 Tjhvqujs Iqoqjy bpg Eqfxtx Xcwwtt";
  13.     s = decrypt(crypto);
  14.     for (r = 0; r < 60;r++)//delete
  15.     printf("%c", s);//delete
  16. }
  17.  
  18.  
  19. int decrypt(char crypto[])
  20. {
  21.     char new_string[N] = "0";
  22.     char c;
  23.     int g, i=0,j=0, count_of_crypto=0,pl=0;
  24.     for (crypto[i]; crypto[i] != '\0' ; i++)
  25.         count_of_crypto++;
  26.     *new_string = (char *)malloc(count_of_crypto * (sizeof(char)));
  27.     //while (crypto != '\0')
  28.     for (g = 0; g < count_of_crypto; g++)
  29.     {
  30.         c = crypto[pl];
  31.         if (c == 32)
  32.         {
  33.  
  34.             new_string[pl] = ' ';
  35.             j=0;
  36.             c = crypto[pl+1];
  37.             pl++;
  38.         }
  39.         new_string[pl] = c - (j+1);
  40.         pl++;
  41.         j++;
  42.     }
  43.     return &new_string;
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment