#include <stdio.h>
int main(void) {
char output[100] = "";
double x = 0.625;
while (x) {
int ch;
double chk = x * 2;
if (chk < 1) ch = '0'; else ch = '1';
sprintf(output
, "%s%c", output
, ch
); x = chk;
if (x >= 1) x -= 1;
}
printf("Representacao final: 0.%s\n", output
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgICBjaGFyIG91dHB1dFsxMDBdID0gIiI7CiAgICBkb3VibGUgeCA9IDAuNjI1OwogICAgd2hpbGUgKHgpIHsKICAgICAgICBpbnQgY2g7CiAgICAgICAgZG91YmxlIGNoayA9IHggKiAyOwogICAgICAgIGlmIChjaGsgPCAxKSBjaCA9ICcwJzsgZWxzZSBjaCA9ICcxJzsKICAgICAgICBzcHJpbnRmKG91dHB1dCwgIiVzJWMiLCBvdXRwdXQsIGNoKTsKICAgICAgICB4ID0gY2hrOwogICAgICAgIGlmICh4ID49IDEpIHggLT0gMTsKICAgIH0KICAgIHByaW50ZigiUmVwcmVzZW50YWNhbyBmaW5hbDogMC4lc1xuIiwgb3V0cHV0KTsKICAgIHJldHVybiAwOwp9Cg==