#include <iostream>

using namespace std;

void printhex(float number)
{
    // rozbijamy sobie ladnie na bajty
    unsigned char address[4];
    unsigned char * wtab = address ;
    // wyciagamy wartosci poszczegolnych bajtow do tablicy charow
    *(reinterpret_cast<float*>(wtab)) = number;
    for(int i=3;i>=0;i--) cout << hex << static_cast<int>(wtab[i]) << " ";
    cout << endl;
}
 
int main()
{
    printhex(5.0);
    printhex(1.0);
    printhex(-1.0);
    printhex(0.0);
    printhex(123.125);
    printhex(-345.0);
    return 0;
}