@@ -0,0 +1,1263 @@
+import java.util.HashMap;%0A%0A/**%0A * Created by fang on 6/1/17.%0A */%0Apublic class FractionToRecurring %7B%0A    public String fractionToDecimal(int numerator, int denominator)%7B%0A        if(numerator==0)%7B%0A            return %220%22;%0A        %7D%0A%0A        StringBuilder res = new StringBuilder();%0A        res.append(((numerator%3E0)%5E(denominator%3E0))? %22-%22:%22%22);%0A        long num = Math.abs((long)numerator);%0A        long den = Math.abs((long)denominator);%0A%0A        res.append(num/den);%0A        num %25=den;%0A        if(num == 0)%7B%0A            return res.toString();%0A        %7D%0A%0A        res.append(%22.%22);%0A        HashMap%3CLong, Integer%3E map = new HashMap%3C%3E();%0A        map.put(num,res.length());%0A        while(num!=0)%7B%0A            num *=10;%0A            res.append(num/den);%0A            num %25=den;%0A            if(map.containsKey(num))%7B%0A                int index = map.get(num);%0A                res.insert(index,%22(%22);%0A                res.append(%22)%22);%0A                break;%0A            %7Delse%7B%0A                map.put(num,res.length());%0A            %7D%0A        %7D%0A        return res.toString();%0A    %7D%0A%0A    public static void main(String%5B%5D args)%7B%0A        int a = 3;%0A        int b = 5;%0A        FractionToRecurring solution = new FractionToRecurring();%0A        solution.fractionToDecimal(a,b);%0A    %7D%0A%0A%7D%0A

A good question need to rewrite.