摘要: #include // cout #include // includes, sort using namespace std; bool myfunction (int i, int j) { return i<j; } int main () { int container[] = {5,10,15,20,25,30,35,40,45,50}; int con... 阅读全文
posted @ 2018-10-21 01:50 anobscureretreat 阅读(929) 评论(0) 推荐(0) 编辑
摘要: #include // cout #include // generate_n using namespace std; int current = 0; int UniqueNumber () { return ++current; } int main () { int myarray[9]; generate_n (myarray, 5, UniqueNu... 阅读全文
posted @ 2018-10-21 01:14 anobscureretreat 阅读(328) 评论(0) 推荐(0) 编辑
摘要: DEV-C++默认的标准是C++98,改成C++11的方法如下: Tools -> Compiler Options -> Setting -> Code Generation -> Language standard(-std),选ISO C++11。 阅读全文
posted @ 2018-10-21 00:59 anobscureretreat 阅读(1469) 评论(0) 推荐(0) 编辑
摘要: #include // cout #include // generate #include // vector #include // time #include // rand, srand using namespace std; // function generator: int RandomNumber () { ret... 阅读全文
posted @ 2018-10-21 00:58 anobscureretreat 阅读(1432) 评论(0) 推荐(0) 编辑
摘要: #include // cout #include // for_each #include // vector using namespace std; void myfunction (int i) { // function: cout myvector; myvector.push_back(10); myvector.push_bac... 阅读全文
posted @ 2018-10-21 00:43 anobscureretreat 阅读(1606) 评论(0) 推荐(0) 编辑
摘要: #include // std::cout #include // std::find_if_not #include // std::array using namespace std; int main () { array foo = {1,2,3,4,5}; array::iterator it =find_if_not (foo.begi... 阅读全文
posted @ 2018-10-21 00:33 anobscureretreat 阅读(541) 评论(0) 推荐(0) 编辑
摘要: #include // std::cout #include // std::find_if #include // std::vector using namespace std; bool IsOdd (int i) { return ((i%2)==1); } int main () { vector myvector; myvector... 阅读全文
posted @ 2018-10-21 00:25 anobscureretreat 阅读(2609) 评论(0) 推荐(0) 编辑
摘要: #include // std::cout #include // std::find_first_of #include // std::vector #include // std::tolower using namespace std; bool comp_case_insensitive (char c1, char c2) { r... 阅读全文
posted @ 2018-10-21 00:20 anobscureretreat 阅读(311) 评论(0) 推荐(0) 编辑