urgent c++ code

Pages: 12
Surprised no one trolled the homework request with example code the calculates a bitwise exclusive OR of two variables.
+1 Zhuge,

Not only is over-complicated, obfuscated code a lot of fun, I always learned something new.
cnoeval wrote:
Not only is over-complicated, obfuscated code a lot of fun, I always learned something new.

I think Zhuge meant
1
2
3
4
5
6
7
#include <iostream>
int main() {
  int a, b;
  std::cin >> a >> b;
  std::cout << (a ^ b) << '\n';
  return 0;
}
Last edited on
Indeed.
1
2
3
4
5
6
7
8
9
#include <iostream>
#define __ int
#define $$ main
#define _$ std::cin
#define $_ std::cout
#define ___ return 0;
#define $_$ '\n'
//Of course, if you want obfusticated...
__ $$(){__ $,_;_$>>$>>_;$_<<($^_)<<$_$;___}
That's actually beyond obfuscation as far as MinGW is concerned ;)
Lol. If you squint you can make out some smiley and winky faces...
Or:
1
2
3
4
5
6
7
8
#include <iostream>
/* definitions omitted. */
_ __ ______ _______ _________ __________ ___________ ____________ ______________ 
	_________________ _______________ ________________ _________________ _____ _ _____________________ _______________________ 
	______________________ _____ _________ __________ ____________________
	__________________ _____________________ __________________ ______________________ _____ _________ __________
	___________ ____________ (_____________________ ___________________ ______________________) ____________ 
	_________ __________ ________________________ _____ ___ ____ _____ ________

(it does work :P)
Last edited on
Topic archived. No new replies allowed.
Pages: 12