Advertisement
dllbridge

Untitled

May 8th, 2024
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.81 KB | None | 0 0
  1.  
  2.  
  3. #include<stdio.h>
  4. #include<string.h>
  5.  
  6. char  narr[99]="APPLE + SONY";
  7.  
  8. void Decoder(char*p);
  9. void Shifr  (char*p);  
  10.  
  11. /////////////////////////////////////////////
  12. int main()                                 //
  13. {
  14.    Shifr(narr);
  15.    printf("narr = %s\n",narr);
  16.    Decoder(narr);
  17.    printf("narr = %s\n",narr);
  18. }
  19.  
  20.  //  Дешифратор
  21. ////////////////////////////////////////////
  22.  void Decoder(char*p)                        //  
  23.  {
  24.    
  25.      int n = strlen(p);
  26.        
  27.      for(int i=0; i < n; i++)   p[i] = p[i]+5;
  28.          
  29.      
  30.  }
  31.  
  32.  
  33.  
  34.  
  35.  //  Шифрование
  36.  ////////////////////////////////////////////
  37.  void Shifr(char*p)                        //
  38.  {
  39.        
  40.      int n = strlen(p);
  41.        
  42.      for(int i=0; i < n; i++)
  43.      {
  44.        p[i] = p[i]-5;  
  45.          
  46.      }
  47.  }
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. /*
  59. #include   <stdio.h>
  60.  
  61. int n = 1;
  62.  
  63. ///////////////////////////////////////////
  64. int main()
  65. {
  66.    
  67.    
  68.     for(int i = 0; i < 11; i++)
  69.     {
  70.        
  71.        printf("n = %4d\n", n);
  72.        
  73.        n = n << 1; 
  74.     }
  75. }
  76.    
  77.    
  78.    
  79.    */
  80.    
  81.    
  82.    
  83.    
  84.    
  85.    
  86.    
  87.    
  88.    
  89.    
  90.    
  91.    
  92.    
  93.    
  94.    
  95.    
  96.    
  97.    
  98.    
  99.    
  100.    
  101.    
  102.  
  103. /*
  104.  
  105.  
  106.  
  107. #include   <stdio.h>
  108.  
  109. int n = 10;
  110.  
  111. ///////////////////////////////////////////
  112. int main()
  113. {
  114.    
  115.    
  116.   //  n *= 2;
  117.     n = n * 2;
  118.    
  119.     printf("n = %d\n", n);    
  120.    
  121.     n = n >> 3;
  122.  
  123.     printf("n = %d\n", n);
  124.    
  125.      
  126. }
  127.  
  128.  
  129. */
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144. /*
  145. #include   <stdio.h>
  146.  
  147. int n = 10;
  148.  
  149. ///////////////////////////////////////////
  150. int main()
  151. {
  152.    
  153.    
  154.   //  n *= 2;
  155.     n = n * 2;
  156.    
  157.     printf("n = %d\n", n);    
  158.    
  159.     n = n >> 1;
  160.  
  161.     printf("n = %d\n", n);
  162.    
  163.     n >>= 1;
  164.  
  165.     printf("n = %d\n", n);    
  166.    
  167.     n = n >> 1;
  168.  
  169.     printf("n = %d\n", n);       
  170. }
  171.  
  172.  
  173.  
  174. */
  175.  
  176.  
  177.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement