Advertisement
harisha

Untitled

Feb 26th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<cstring>
  4. using namespace std;
  5.  
  6. void szyfrCezara(int klucz, char tab[])
  7. {
  8.  int dl = 63;
  9.   if(klucz >= 0)
  10.     for(int i=0;i<dl;i++)
  11.       tab[i] = (tab[i] - 65 + klucz)%26 + 65;
  12.   else
  13.     for(int i=0;i<dl;i++)
  14.       tab[i] = (tab[i] + 65 + klucz)%26 + 65;  
  15.  
  16. }
  17. void szyfrRot13(int tabpodst)
  18. {
  19.     int pom[63];
  20.     for(int i=0; i<64;i++)
  21.     {
  22.         tab[i]=
  23.     }
  24. }
  25.  
  26. int main()
  27. {
  28.     char tabpodst[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  29.     char tab[63]={'R','I','T','B','B','F','O','R','C','V','E','A','F','N','C','T','E','M','V','T','G','Q','R','F','H','E','Z','A','P','C','B','V','B','A','P','H','B','B','P','R','Z','C','L','A','V','S','V','H','T','C','R','L','G','E','L','P','J','T','C','R','U','V','J'};
  30.  
  31.   //int klucz = 6;
  32.  
  33.  
  34.     szyfrCezara(-klucz,tab); //deszyfrowanie
  35.     cout<<"Po rozszyfrowaniu: "<<tab<<endl;
  36.     szyfrRot13();
  37.     cout<<"aaa: "<<tab<<endl;
  38.   system("pause");
  39.   return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement