From c3a48f3bbf0996c50be692b53435fe5fa27c7bce Mon Sep 17 00:00:00 2001 From: cmirnov Date: Thu, 8 Oct 2015 21:46:46 +0300 Subject: [PATCH 1/3] Create bitXor --- bitXor | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 bitXor diff --git a/bitXor b/bitXor new file mode 100644 index 0000000..f860039 --- /dev/null +++ b/bitXor @@ -0,0 +1,8 @@ +void bitXor () +{ + int a, b; + scanf("%d%d", &a, &b); + int res = (~((~a)&b))&(~(a&(~b))); + printf("%d %d", ~res); + return; +} From 1babc980a4c20a08ffc87125305552c98fbcbe42 Mon Sep 17 00:00:00 2001 From: cmirnov Date: Fri, 23 Oct 2015 11:07:17 +0300 Subject: [PATCH 2/3] Update bitXor --- bitXor | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bitXor b/bitXor index f860039..b09ec75 100644 --- a/bitXor +++ b/bitXor @@ -1,8 +1,5 @@ -void bitXor () -{ - int a, b; - scanf("%d%d", &a, &b); - int res = (~((~a)&b))&(~(a&(~b))); - printf("%d %d", ~res); - return; +int bitXor (int x, int y) { + int res = (~((x) & y)) & (~(x & (~y))); + printf("%d", ~res); + return 2; } From 88bdf7d8ba0dcbc1954363291ec282be6677421d Mon Sep 17 00:00:00 2001 From: cmirnov Date: Tue, 27 Oct 2015 15:44:49 +0300 Subject: [PATCH 3/3] Update bitXor --- bitXor | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bitXor b/bitXor index b09ec75..a322f18 100644 --- a/bitXor +++ b/bitXor @@ -1,5 +1,4 @@ int bitXor (int x, int y) { - int res = (~((x) & y)) & (~(x & (~y))); - printf("%d", ~res); - return 2; + int res = (~(x & y)) & (~((~x) & (~y))); + return res; }