Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string szyfr(string s) {
- string pom="";
- for(int i=0;i<s.size()-1;i+=2)
- {
- pom=pom+s[i+1]+s[i];
- }
- if(s.size()%2!=0)
- pom=pom+s[s.size()-1];
- return pom;
- }
- int main()
- {
- cout<<"szyfrowanie jest trudne"<<endl<<szyfr("szyfrowanie jest trudne")<<endl;
- cout<<szyfr("koywica");
- }
- // zdefiniuj funkcję i sprawdź jej działanie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement