+ 6

🔥 🔥 🔥 Challenge!

Disambiguate this code... https://code.sololearn.com/c2ZHog8DYLy0/?ref=app // The most interesting thing about the code is that it's C++ and {C++ == *C++ === &C++ == easy to hack} good luck.

2nd Jul 2017, 8:17 AM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
8 odpowiedzi
+ 7
@Nomeh : Then, I misunderstood the challenge. According to my disambiguous version of your code, b = 0 i1 = 0 ^ 0 = 1 i2 = 1 + 1 = 2 i3 = 2 * 2 = 4 i4 = 2 * 2 * 2 - 1 = 7 i5 = 4 ^ 7 = 16384
2nd Jul 2017, 1:50 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 12
#include <iostream> #include <cmath> using namespace std; class Krishna { }; int main() { string s0; cin >> s0; string s1 = "Hello! Sololearner @"; string s2 = "The output is:"; string s3 = ","; string s4 = "\n"; string s5 = " "; string s6 = "-----"; bool b = false; int i1 = pow(b, b); int i2 = i1 + i1; int i3 = i2 * i2; int i4 = i2 * (i2 * i2) - i1; int i5 = pow(i3, i4); cout << s1 << s0 << s3 << s5 << s4 << s2 << s4 << s6 << s4 << i5 << s4 << s6; }
2nd Jul 2017, 9:03 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 3
hmm, kudos @krishna. And Nomeh excellent brain task. We need more like this..
2nd Jul 2017, 9:05 PM
CMD
CMD - avatar
+ 2
what's going on here? can anyone explain?
2nd Jul 2017, 12:39 PM
Luyanda
Luyanda - avatar
+ 2
@Luyanda, The code above was written in anonymous variables but I need someone to explain what clearly led to the output “16384”... good luck!
2nd Jul 2017, 1:07 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 2
@Nomen are the variable names a sequence of underscores?
2nd Jul 2017, 1:34 PM
Luyanda
Luyanda - avatar
+ 1
if you can answer it correctly, then see yourself as an on-demand hacker.
2nd Jul 2017, 8:19 AM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 1
Excellent! @Krishna, You really deserve the apex position... finally you have proved that all numbers are contained in zero as all colors came from white.
2nd Jul 2017, 4:57 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar