OJ-Problems-Source/HDOJ/1289_autoAC.cpp
2016-08-13 17:16:08 +08:00

15 lines
322 B
C++

#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
float x;
while (cin >> x) {
int cnt = 0;
while (fabs(x) >= 2.0) x /= 2.0, cnt++;
while (fabs(x) < 1.0) x *= 2.0, cnt--;
printf("%d %.6f\n", cnt, x);
}
return 0;
}