循环小数
poj1930 # include <stdio.h> # include <string.h> # include <iostream> # include <math.h> # include <algorithm> using namespace std ; typedef unsigned long long ll ; # define SIS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); const ll MAXN = 45000 ; const int MOD = 10000000 ; ll gcd ( ll a , ll b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } int main ( ) { char str [ 100 ] ; int num , k , all , a , b , i , j , mina , minb , l ; while ( cin >> str && strcmp ( str , "0" ) ) { mina = minb = 1000000000 ; for ( i = 2 , all = 0 , l = 0 ; str [ i ] != '.' ; i ++ ) { all = all *