- 博客(6)
- 资源 (15)
- 收藏
- 关注
原创 atof的简单实现
#include #include using namespace std; float My_atof(char str[]); int main() { char str[10] = "+34.5"; float num; num = My_atof(str); cout<<num<<endl; return 0; } float My_atof
2013-08-24 11:41:39
488
转载 ftoa的简单实现
转载自csdnhttp://blog.youkuaiyun.com/zhangleiyigeren/article/details/6308168 收藏了,自己学习一下[cpp] view plaincopyprint? 01.#include 02.#include 03.#include 04.#include 05.#include 06.char*
2013-08-24 11:24:13
2913
转载 统计所有0到n之间所有含有数字1的数字和
实现函数int func(unsigned n),其中n为正整数,返回从1到n(包含1和n)之间出现的1的个数,如 func(13)=6,func(9)=1。(注意:不能将整数转化为字符串) 这是网上一位兄弟的分析: 分析: 这个问题可以分解为:对于一个有digit位的数,可以统计其每个位上出现1的次数,遍历每个位,累计的次数即为出现1的次数之和 对于数n,可以把它分成三段,高位
2013-08-22 11:48:33
1562
转载 c++ string类的操作函数总结
二、标准的C++string类 string类在很多地方改动了c字符串。首先,在创建数组时不必再为它的大小是否能够容纳字符串变量而担心,因为string类接管了所有的内存管理任务。其次,string类允许使用重载运算符,因此可以使用(+、=、==、)等运算符操作字符串对象:s3=s1+s2; 1.string对象的定义: 1)string s(“man”); 2)string s=”m
2013-08-21 20:02:11
778
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人