C++
lj-root
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
vector 基本使用
vector 基本使用 #include <iostream> #include <vector> using namespace std; void myPrintf(vector<int>& v, string s){ cout << "=========" << s << "=========" << endl; cout << "capacity:" << v.c原创 2021-04-11 22:18:42 · 176 阅读 · 0 评论 -
bitset 基本使用
bitset 基本使用 #include <iostream> #include <bitset> #include <string> using namespace std; int main(){ std::bitset<5> bs1("1001"); std::string str1 = bs1.to_string(); cout << str1 << endl; // 01001 高位自原创 2021-04-10 23:51:05 · 216 阅读 · 0 评论 -
递归模板
递归模板 #include<iostream> #include<vector> using namespace std; template<int n> struct Factorial{ const static int value=Factorial<n-1>::value*n; }; //特化终结递归,否则上面那个递归会死循环,编译时报错 template<> struct Factorial<0> { const s原创 2021-04-10 23:27:55 · 201 阅读 · 0 评论
分享