mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
15 lines
322 B
C++
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;
|
|
}
|