preternatural

2007年10月3日

C++把string转换成double,求整数a/b精确到小数点后任意位

摘要: //cppTest.cpp:定义控制台应用程序的入口点。//#include"stdafx.h"#include<cassert>#include<iomanip>//求a/b,输出结果小数点后的前n位voidDiv(inta,intb,intn){usingnamespacestd;assert(n>=0);if(a<b)cout<<"0.";el... 阅读全文

posted @ 2007-10-03 20:56 preternatural 阅读(6870) 评论(0) 推荐(0) 编辑

导航