//#505795 のコードをちょっと変えてみます(実験) #include using namespace std; long long gcd(long long x, long long y) { if(y == 0) return x; return gcd(y, x % y); } int main() { double d; cin >> d; long long N = (long long)(d * 1000000000); long long g = gcd(N, 1000000000); cout << N / g << "/" << 1000000000 / g << endl; return 0; }