'Bit Test' challenge... the strange coding.. please help me.
'Bit Test' challenge... the strange coding.. please help me.
please help me to solve this challenge... i never seen a coding with 'bool' word like that before... please help me an explain to me about this coding.. and how to solve the challenge... thanks so much..
~� dorahan �~
HkRkoz al KuwaiT 2019 HaCkEr 101
HkRkoz al KuwaiT 2019 HaCkEr 101
-
- Posts: 144
- Joined: Fri Mar 28, 2008 11:29 pm
- Location: #hacker.org on Freenode
-
- Posts: 144
- Joined: Fri Mar 28, 2008 11:29 pm
- Location: #hacker.org on Freenode
-
- Posts: 144
- Joined: Fri Mar 28, 2008 11:29 pm
- Location: #hacker.org on Freenode
Hello hackers.
This is my first post.
My English isn't so good.
You see, I'm from Greece and I don't know how to translate some things in English.
I am also new in Linux, thanks to this forum, and I don't know how to run a c++ project.
Neither how to find and install translators, programs, etc.
I managed to solve some of the tests in windows, which I am using for years, but Linux is hard for me.
About the test, I can only say that
it has an integer input
it tests if both values (&) have the price of zero
But how can x and x-1 have the same price?
I think it always return false (-1)
Could you please help me?
This is my first post.
My English isn't so good.
You see, I'm from Greece and I don't know how to translate some things in English.
I am also new in Linux, thanks to this forum, and I don't know how to run a c++ project.
Neither how to find and install translators, programs, etc.
I managed to solve some of the tests in windows, which I am using for years, but Linux is hard for me.
About the test, I can only say that
it has an integer input
it tests if both values (&) have the price of zero
But how can x and x-1 have the same price?
I think it always return false (-1)
Could you please help me?
In most languages, C and C++ included, true is any non-zero number.
This makes -1 true.
0 is the only false value.
Otherwise I don't know much more about this puzzle.
Oh, to compile a C or C++ program on GNU/Linux, you would do:
, if it's a c program
OR, if it's a c++ program.
Obviously change file.cpp or file.c to the filename of the source code. If they compile without problem, you can go ahead and do:
Which will run the code.
This makes -1 true.
0 is the only false value.
Otherwise I don't know much more about this puzzle.
Oh, to compile a C or C++ program on GNU/Linux, you would do:
Code: Select all
gcc file.c -o file
OR
Code: Select all
gcc file.cpp -o file -lstdc++
Obviously change file.cpp or file.c to the filename of the source code. If they compile without problem, you can go ahead and do:
Code: Select all
./file
-
- Posts: 16
- Joined: Tue Jul 15, 2008 8:07 pm
- Location: Illinois