Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- char* decrypt(char[]);
- void main()
- {
- int r;
- char *s, crypto[] ="Btwlzx Dqqes Eq|pj2 Tjhvqujs Iqoqjy bpg Eqfxtx Xcwwtt";
- s = decrypt(crypto);
- //ככה מדפיסים
- printf("%s\n",s);
- }
- char* decrypt(char crypto[])
- {
- char *new_string;
- char c;
- int g, i=0,j=0, count_of_crypto=0,pl=0;
- for (crypto[i]; crypto[i] != '\0' ; i++)
- count_of_crypto++;
- new_string = (char *)malloc(count_of_crypto * (sizeof(char)));
- for (g = 0; g < count_of_crypto; g++)
- {
- c = crypto[pl];
- if (c == 32)
- {
- new_string[pl] = ' ';
- j=0;
- c = crypto[pl+1];
- pl++;
- }
- new_string[pl] = c - (j+1);
- pl++;
- j++;
- }
- *(new_string + count_of_crypto) = '\0';
- return new_string;
- }
Advertisement
Add Comment
Please, Sign In to add comment