Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <sstream>
  4. #include <string>
  5. using namespace std;
  6.  
  7. string szyfruj(string napis, int klucz)
  8. { int kod; string szyfr="";
  9. for(int i=0;i<napis.length();i++)
  10. {
  11. kod=int(napis[i]);
  12. kod=kod+klucz;
  13. while(kod<32||kod>127)
  14. {
  15. if(kod>127) kod=kod-96;
  16. if(kod<32) kod=kod+96;
  17. }
  18. szyfr=szyfr+char(kod);
  19. }
  20. return szyfr;
  21. }
  22.  
  23. int main()
  24. {
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement