Comment detail
LL Golf Hole 7 - バイト数を読みやすくする (Nested Flatten)#7312と同じ考えでC++で。入力は標準入力。 133bytes。実質132bytes
1 2 3 | #include <iostream>
char*p=" \bKiMiGiTiPiEiZiYi";
main(){double n;std::cin>>n;for(;1024<n;p+=2)n/=1024;std::cout<<n<<*p<<p[1]<<"B";}
|
#7312と同じ考えでC++で。入力は標準入力。 133bytes。実質132bytes
1 2 3 | #include <iostream>
char*p=" \bKiMiGiTiPiEiZiYi";
main(){double n;std::cin>>n;for(;1024<n;p+=2)n/=1024;std::cout<<n<<*p<<p[1]<<"B";}
|
turugina
#7312()
[
XSLT
]
Rating0/0=0.00
<transform version="2.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:y="y"> <output method="text"/><param name="n"/> <variable name="u" select="('B','KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB')"/> <template match="/"><value-of select="y:f($n,1)"/></template> <function name="y:f"><param name="m"/><param name="i"/> <sequence select="if($m<1024)then($m,$u[$i])else y:f(round-half-to-even($m div 1024,2),$i+1)"/> </function></transform>Rating0/0=0.00-0+
1 reply [ reply ]