Programming notes -① training exercises topic

Binary conversion issues

 

A hex

 

The first analysis of this question, two points, put a hex string into a decimal integer, the second traverse the entire string, beginning to find substring of 0x.

Title relatively simple, directly on the part of the code

16 hex 10 hex turn, may become changed by a slight modification applied to the other wheel int decimal binary string

 

 Each 0x found, the new index, Hex substring is obtained after 0x

 

 Second, the binary conversion

 

 This problem with the opposite problem, into any decimal digit string

Very simple, performing a modulo operation, Euclidean algorithm operates directly on the code

 

 Third, octal, decimal

 

 This next question write it, before the code ugly, heavy wrote.

 

Guess you like

Origin www.cnblogs.com/Notherthing-hyc/p/11518016.html