摘要: 22/7取第300位小数,代码如下:public Int32 Result(Int32 d1, Int32 d2,Int32 nowCount,Int32 endCount) { if(d1d2){ d1*=10; } if (nowCount == endCount) { return d1 / d2; } else { return Result(d1 % d2, d2, ++nowCount,endCount); } }测试的代码如下:[TestMethod()] public void ResultTest() { //3.14285714285714 TwentyTwoDivi 阅读全文
posted @ 2010-12-15 15:02 chenping2008 阅读(297) 评论(1) 推荐(0) 编辑