fork download
  1. #include <iostream>
  2.  
  3. class Enigma {
  4. public:
  5. Enigma() : a{0xf0,0x0f,0xaa,0x33} {};
  6. unsigned char &operator[] (size_t idx) {
  7. return a[idx % 3];
  8. }
  9. private:
  10. unsigned char a[4];
  11. };
  12.  
  13. int main() {
  14. Enigma Eni;
  15. unsigned char Str[] = "Hello World!";
  16. for (size_t i=0; i<12; i++) std::cout << (Str[i]^Eni[i]) << " ";
  17. std::cout << std::endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
184 106 198 156 96 138 167 96 216 156 107 139