Advertisement
Guest User

piotrek gej

a guest
Mar 31st, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char alfabet[]={'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'};
  8.  
  9. int a=0,b=0;
  10. string wyraz,kod;
  11. cout << "Podaj wyraz do szyfrowania:" <<endl;
  12. cin >> wyraz;
  13. int dlugosc=wyraz.length();
  14.  
  15. for (int i=0;i<dlugosc;i++)
  16. {
  17. for (int j=0; j<26;j++)
  18. {if (wyraz[i]==alfabet[j]){a=j+i+1;}
  19. }
  20. cout<<alfabet[a];
  21.  
  22. }
  23. cin.ignore();
  24. getchar();
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement