Guest User

Untitled

a guest
Jun 9th, 2011
429
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MacBook-vas3k:~ vas3k$ cat xor.cpp
  2. #include <stdio.h>
  3.  
  4. int main() {
  5.     int a[] = {45, 23, 12, 67, 23};
  6.     int b = 0;
  7.     for (int i = 0; i < 5; i++) {
  8.         b = b xor a[i];
  9.     }
  10.     printf("%d\n", b);
  11.     return 0;
  12. }
  13.  
  14.  
  15. MacBook-vas3k:~ vas3k$ g++ xor.cpp
  16. MacBook-vas3k:~ vas3k$ ./a.out
  17. 98
RAW Paste Data