一.问题
Write ONE C(也可是c++) Program to accomplish the following task: Convert a double number to its hexadecimal form.
Constraints:
(1) The double number x is located between 0 and 1000 (0 <= x < =1000), e.g. 678.345.
(2) The double number with the hexadecimal form contains 6 significant digits. e.g. “5D.32FA45”.
(3) The double number with the hexadecimal form is represented by a string (or a character array), e.g. “5D.32FA45”.
The possible steps are as follows:
1) Split a double number into the integer part and the fractional part;
2) Convert the integer part into its hexadecimal form;
3) Convert the fractional part into its hexadecimal form;
4) Combine both parts into a string;
最好有注释。。