fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int key = 42;
  5.  
  6. wstring crypt(wstring input){
  7. for (int i = 0; i < input.size(); i++) {
  8. input[i] ^= key;
  9. }
  10. return input;
  11. }
  12.  
  13. wstring decrypt(wstring input) {
  14. return crypt(input);
  15. }
  16.  
  17. int main() {
  18. wcout << crypt(L"bitcoin is a ponzi scheme") << endl;
  19. wcout << decrypt(crypt(L"bitcoin is a ponzi scheme")) << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 4408KB
stdin
Standard input is empty
stdout
HC^IECD
CY
K
ZEDPC
YIBOGO
bitcoin is a ponzi scheme