Răspuns :
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("var27.in");
ofstream fout("var27.out");
double x, pfrac;
int pint;
long long convPInt(int m)
{
long long pib=0, z=1,cif;
while (m)
{
cif=m%2;
pib=cif*z+pib;
z=z*10;
m=m/2;
}
return pib;
}
int convPFr(double y)
{
long long cif, zecimal, i;
double prod;
for (i=1; i<10; ++i)
{
prod=y*2;
cif=(int)(prod);
zecimal=zecimal*10+cif;
y=prod-(int)prod;
}
return zecimal;
}
int main()
{
fin >> x;
pint=(int)x;
fout << convPInt(pint) << ",";
pfrac=x-pint;
fout << convPFr(pfrac);
}