Tom Lin wrote:
> But one precondition is not to use int(string, base). How would you
> implement the conversion?
It's not hard. You have two choices: each character of the string
represents a bit, and should be either a "0" or a "1" (anything else is
an error). In which case its numeric value is
δΊ 2011-1-18 21:08, Christian Witts ει:
> On 18/01/2011 14:45, Tom Lin wrote:
>> Hi guys,
>>
>> Please help me with this:
>> Convert an IP address from binary string to decimal format.There are
>> some preconditions:
>> 1.IP address is in the form of '10010001100'.32 bits with no dot.
>> 2.i
Tom Lin wrote:
> Hi guys,
>
> Please help me with this:
We don't do homework. We'll give you some hints but not do the work.
> Convert an IP address from binary string to decimal format.There are
> some preconditions:
> 1.IP address is in the form of '10010001100'.32 bits with no dot.
>
On 1/18/2011 8:08 AM, Christian Witts wrote:
On 18/01/2011 14:45, Tom Lin wrote:
Hi guys,
Please help me with this:
Convert an IP address from binary string to decimal format.There are
some preconditions:
1.IP address is in the form of '10010001100'.32 bits with no dot.
2.int(string, ba
On 18/01/2011 14:45, Tom Lin wrote:
> Hi guys,
>
> Please help me with this:
> Convert an IP address from binary string to decimal format.There are
> some preconditions:
> 1.IP address is in the form of '10010001100'.32 bits with no dot.
> 2.int(string, base) is not allowed, You have to imp
Hi guys,
Please help me with this:
Convert an IP address from binary string to decimal format.There are
some preconditions:
1.IP address is in the form of '10010001100'.32 bits with no dot.
2.int(string, base) is not allowed, You have to implement the conversion .
3.Performance should be c