omarking05 wrote:well im sorry to post new thread in this section but the reason of doing that , that posting a reply in the original thread always don't get much care .
I think most experienced users of this forum are happier and more willing to help when people follow the rules, which includes not creating new threads when it's not necessary. But that's just my opinion
![:)](./images/smilies/icon_smile.gif)
.
omarking05 wrote:
yes i think that UNSIGNED 32BIT NUMBERS is the main reason of the WA xD ..
After taking a second look at your code, I'd say it shows signs of some big gaps in your knowledge about bits/bytes and basic data types.
My suggestion is that you take a step back, take your time to read about data types (learn about the magnitudes of integers that 32-bit and 64-bit int variables can hold, how signed and unsigned variables differ, etc.), and about bits and bitwise operations. It's very important to have a strong understanding of the fundamentals, so don't feel pressured to skip things or move too quickly, go at your own pace.
You should eventually come to understand the errors in your approach. For example, think about the maximum number of
decimal digits an "unsigned long long" variable can have, and the number of
binary digits in a number like 2147483648.
omarking05 wrote:i know that there is more simple way with one line of code xD but i didn't get it
As I said, take your time. If you feel this problem is a little too confusing for you right now, try other problems. Come back to this one later on when you have some more experience and knowledge about bits, bytes, data types, etc.
Good luck
![:)](./images/smilies/icon_smile.gif)
.