From 5e6954e218455d912686f9adda25ddcd09ca267c Mon Sep 17 00:00:00 2001 From: Oskar Date: Thu, 22 Aug 2024 20:07:49 +0200 Subject: difficult exercise --- 4p33.cpp | 6 ++---- 1 file 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; } -- cgit v1.2.3