fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b;
  6. scanf("%d%d", &a, &b);
  7. while(b) {
  8. a ^= b;
  9. b &= (~a);
  10. b <<= 1;
  11. }
  12. printf("%d\n", a);
  13. return 0;
  14. }
Success #stdin #stdout 0s 3464KB
stdin
15 303
stdout
318