Advertisement
tinyevil

Untitled

Jul 29th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. class Secret{
  2. public:
  3.     Secret(int k){
  4.         a = rand();
  5.         b = k ^ a;
  6.     }
  7.    
  8.     Secret(const Secret& secret){
  9.         a = rand();
  10.         b = secret.get() ^ k;
  11.     }
  12.  
  13.     int get(){
  14.         return a ^ b;
  15.     }
  16.    
  17. private:
  18.     int a, b;
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement