您的位置:首页 > 编程语言 > C语言/C++

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

2007-10-03 20:56 435 查看
// cppTest.cpp : 定义控制台应用程序的入口点。

//

#include "stdafx.h"

#include <cassert>

#include <iomanip>

// 求a/b,输出结果小数点后的前n位

void Div(int a, int b, int n)

inline bool IsNum(const char c)

inline bool IsAlpha(const char c)

// 从字符串str中获得一个浮点数

// start表示这个浮点数在客串中的起始位置。end表示浮点数结束的下一个位置

// dot表示小数点所在的位置

bool CheckString(const char* str, int& start, int& dot, int& end)

double Pow(const int a, const int b)

// 把一个字符串转化成double型的浮点数

double Atof(const char* str)

void SerializePositive(int n)

#include <list>

int _tmain(int argc, _TCHAR* argv[])
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: