Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- string tekst;
- int x;
- cout<<"podaj tekst do zaszyfrowania"<<endl;
- cin >>tekst;
- cout<<"podaj wspolczynnik przesuniecia"<<endl;
- cin >> x;
- for(int i=0;i<=tekst.length();i++){
- if(tekst[i]>=65 && tekst[i]<=90-x) tekst[i]=int(tekst[i])+x;
- else if(tekst[i]>=91-x && tekst[i]<=90) tekst[i]=int(tekst[i])-26+x;
- }
- cout << tekst<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement