Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- char narr[99]="APPLE + SONY";
- void Decoder(char*p);
- void Shifr (char*p);
- /////////////////////////////////////////////
- int main() //
- {
- Shifr(narr);
- printf("narr = %s\n",narr);
- Decoder(narr);
- printf("narr = %s\n",narr);
- }
- // Дешифратор
- ////////////////////////////////////////////
- void Decoder(char*p) //
- {
- int n = strlen(p);
- for(int i=0; i < n; i++) p[i] = p[i]+5;
- }
- // Шифрование
- ////////////////////////////////////////////
- void Shifr(char*p) //
- {
- int n = strlen(p);
- for(int i=0; i < n; i++)
- {
- p[i] = p[i]-5;
- }
- }
- /*
- #include <stdio.h>
- int n = 1;
- ///////////////////////////////////////////
- int main()
- {
- for(int i = 0; i < 11; i++)
- {
- printf("n = %4d\n", n);
- n = n << 1;
- }
- }
- */
- /*
- #include <stdio.h>
- int n = 10;
- ///////////////////////////////////////////
- int main()
- {
- // n *= 2;
- n = n * 2;
- printf("n = %d\n", n);
- n = n >> 3;
- printf("n = %d\n", n);
- }
- */
- /*
- #include <stdio.h>
- int n = 10;
- ///////////////////////////////////////////
- int main()
- {
- // n *= 2;
- n = n * 2;
- printf("n = %d\n", n);
- n = n >> 1;
- printf("n = %d\n", n);
- n >>= 1;
- printf("n = %d\n", n);
- n = n >> 1;
- printf("n = %d\n", n);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement