Skip to content

Latest commit

 

History

History
53 lines (31 loc) · 993 Bytes

File metadata and controls

53 lines (31 loc) · 993 Bytes

中文文档

Description

Given a real number between O and 1 (e.g., 0.72) that is passed in as a double, print the binary representation. If the number cannot be represented accurately in binary with at most 32 characters, print "ERROR".

Example1:

Input: 0.625

Output: "0.101"

Example2:

Input: 0.1

Output: "ERROR"

Note: 0.1 cannot be represented accurately in binary.

Note:

  1. This two charaters "0." should be counted into 32 characters.

Solutions

Python3

Java

...