summaryrefslogtreecommitdiff
path: root/4p33.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-22 20:07:49 +0200
committerOskar <[email protected]>2024-08-22 20:07:49 +0200
commit5e6954e218455d912686f9adda25ddcd09ca267c (patch)
tree592778f24dd6d29ee23fd8682373b50728266263 /4p33.cpp
parent456ce2efc1a2f14cdaa853ec9a95945a77ff2a08 (diff)
difficult exercise
Diffstat (limited to '4p33.cpp')
-rw-r--r--4p33.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/4p33.cpp b/4p33.cpp
index fa4f199..7162e87 100644
--- a/4p33.cpp
+++ b/4p33.cpp
@@ -4,7 +4,7 @@
*
* 4.33
*
- *
+ * Wow this might have been the trickiest question ever. I'm still not even sure if i totally get it!
*/
int main () {
@@ -13,11 +13,9 @@ int main () {
int res;
int x = 1;
int y = 1;
- // (sameValue ? (++x, ++y) : --x), --y
- res = someValue ? ++x, ++y : --x, --y;
+ res = (someValue ? (++x, ++y) : --x), --y;
std::cout << res << " res"<< std::endl;
std::cout << x << " x" << std::endl;
std::cout << y << " y" << std::endl;
-
return 0;
}