Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- 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'};
- int a=0,b=0;
- string wyraz,kod;
- cout << "Podaj wyraz do szyfrowania:" <<endl;
- cin >> wyraz;
- int dlugosc=wyraz.length();
- for (int i=0;i<dlugosc;i++)
- {
- for (int j=0; j<26;j++)
- {if (wyraz[i]==alfabet[j]){a=j+i+1;}
- }
- cout<<alfabet[a];
- }
- cin.ignore();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement