随笔分类 -  c++

摘要:#include // cout #include // find_end #include // vector using namespace std; void paint(int,int); void judge(int [],int [],int,int,int,int,int); void paint(int i,int j){ coutB[... 阅读全文
posted @ 2018-10-19 22:36 anobscureretreat 阅读(185) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // find #include // vector #include using namespace std; int main () { // using find with array and pointer: int myints[] = { 10, 20, 30, 40 };... 阅读全文
posted @ 2018-10-19 16:31 anobscureretreat 阅读(10596) 评论(0) 推荐(1) 编辑
摘要:#include // cout #include // fill_n #include // vector using namespace std; int main () { vector myvector (8,10); // myvector: 10 10 10 10 10 10 10 10 fill_n (my... 阅读全文
posted @ 2018-10-19 16:09 anobscureretreat 阅读(461) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // fill #include // vector using namespace std; int main () { vector myvector (8); // myvector: 0 0 0 0 0 0 0 0 fill (my... 阅读全文
posted @ 2018-10-19 15:57 anobscureretreat 阅读(1058) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // equal_range, sort #include // vector using namespace std; bool mygreater (int i,int j) { return (i>j); } int main () { int myints[] = {10,20,30,30,... 阅读全文
posted @ 2018-10-19 15:39 anobscureretreat 阅读(477) 评论(0) 推荐(1) 编辑
摘要:#include // cout #include // equal #include // vector using namespace std; bool mypredicate (int i, int j) { return (i==j); } int main () { int myints[] = {20,40,60,80,100}... 阅读全文
posted @ 2018-10-19 14:54 anobscureretreat 阅读(2218) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // count_if #include // vector using namespace std; bool IsOdd (int i) { return ((i%2)!=0); } int main () { vector myvector; for (int i=1; i<10; i... 阅读全文
posted @ 2018-10-19 14:31 anobscureretreat 阅读(1264) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // count #include // vector using namespace std; int main () { // counting elements in array: int myints[] = {10,20,30,30,20,10,10,20}; // 8 elem... 阅读全文
posted @ 2018-10-19 14:24 anobscureretreat 阅读(2843) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> // cout #include <algorithm> // copy #include <vector> // vector using namespace std; int main () { int myints[]={10,20,30,40,50,6 阅读全文
posted @ 2018-10-19 14:15 anobscureretreat 阅读(911) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // copy_if, distance #include // vector using namespace std; int main () { vector foo = {25,15,5,-5,-15}; vector bar (foo.size()); // copy... 阅读全文
posted @ 2018-10-19 14:10 anobscureretreat 阅读(599) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // copy_backward #include // vector using namespace std; int main () { vector myvector; // set some values: for (int i=1; i::iterator it=m... 阅读全文
posted @ 2018-10-19 13:50 anobscureretreat 阅读(620) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // copy #include // vector using namespace std; int main () { int myints[]={10,20,30,40,50,60,70}; vector myvector (7); copy ( myints, myi... 阅读全文
posted @ 2018-10-19 11:29 anobscureretreat 阅读(2026) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // adjacent_find #include // vector using namespace std; bool myfunction (int i, int j) { return (i==j); } int main () { int myints[] = {5,5,20,30... 阅读全文
posted @ 2018-10-19 11:17 anobscureretreat 阅读(502) 评论(0) 推荐(0) 编辑
摘要:#include // cout #include // binary_search, sort #include // vector using namespace std; bool myfunction (int i,int j) { return (i v(myints,myints+9); // 1 2... 阅读全文
posted @ 2018-10-19 10:54 anobscureretreat 阅读(1024) 评论(0) 推荐(0) 编辑
摘要:#include // std::cout #include // std::any_of #include // std::array using namespace std; int main () { array foo = {0,1,-1,3,-3,5,-5}; if ( any_of(foo.begin(), foo.en... 阅读全文
posted @ 2018-10-19 10:30 anobscureretreat 阅读(1044) 评论(0) 推荐(0) 编辑
摘要:#include // std::cout #include // std::all_of #include // std::array using namespace std; int main () { array foo = {3,4,7,11,13,17,19,23}; if ( all_of(foo.begin(), fo... 阅读全文
posted @ 2018-10-19 10:27 anobscureretreat 阅读(445) 评论(0) 推荐(0) 编辑
摘要:构造的顺序是继承的顺序 阅读全文
posted @ 2018-09-07 13:32 anobscureretreat 阅读(116) 评论(0) 推荐(0) 编辑