摘要: #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 阅读(183) 评论(0) 推荐(0) 编辑
摘要: if(A[0]>B[0]){ if(A[1]>B[1]){ for(int i=B[0];i<=A[0];i++){ for(int j=B[1];j<=A[1];j++){ paint(i,j); } } }else if (A[1]<B[1]){ for(int i=B[0];i<=A[0];i 阅读全文
posted @ 2018-10-19 20:55 anobscureretreat 阅读(203) 评论(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 阅读(10448) 评论(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 阅读(456) 评论(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 阅读(1029) 评论(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 阅读(476) 评论(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 阅读(2165) 评论(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 阅读(1251) 评论(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 阅读(2758) 评论(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 阅读(896) 评论(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 阅读(597) 评论(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 阅读(611) 评论(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 阅读(2013) 评论(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 阅读(500) 评论(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 阅读(1017) 评论(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 阅读(1013) 评论(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 阅读(437) 评论(0) 推荐(0) 编辑