- 博客(4)
- 资源 (1)
- 收藏
- 关注
转载 sunday算法的实现
github上的一个sunday算法的实现。原文地址https://github.com/coderchen/leetcode/b#include #include using namespace std;int sunday(string match, string pattern){ int m = match.size(); int n = pattern.size();
2017-04-25 20:53:34
577
原创 KMP算法的实现
#include #include #include using namespace std;vector Compute_M_Function(string s);void KMP_MATCHER(string s, string p){ int n = s.size(); int m = p.size(); vector svec = Compute_M_Function(p
2017-04-25 15:57:30
239
原创 C++string和int类型的转换方法
总结一下C++中string和int的两种转换方法。第一种:使用C标准库中的函数atoi()和itoa():#include #include using namespace std;int main(){ string s = "250"; int n = atoi(s.c_str()); cout << typeid(n).name() << ": " << n <<
2016-12-01 16:49:45
2027
原创 C++分数的表达,C++的<ratio>头文件
自从C++11以后C++的标准库提供了ratio模板类,它提供了一些分数的基本操作,并且能够减少溢出的可能性,并且能够自动去除除零错误。该类定义在ration头文件下。该模板的主要构成为其中num代表分子,den代表分母,constexpr修饰符表示这个变量是在编译时计算的。intmax_t是在头文件的用64比特表示的类型。vs2013中表示如下(分子分母都除以了最大公约数
2016-11-15 20:09:25
7549
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人