2進数に変換。これは簡単。
正答率82%
((316.0/(316+68))*100).round
設問
Given a decimal (base 10) number, print out its binary representation.
Input sample:
File containing positive whole decimal numbers, one per line. e.g.
2 10 67
Output sample:
Print the decimal representation, one per line.
e.g.
10 1010 1000011
やってみた
#!/usr/bin/env ruby ARGF.lines do |line| puts line.to_i.to_s 2 end