This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
#include <cctype> | |
#include <algorithm> | |
using namespace std; | |
std::vector<string> split(const string &s) | |
{ | |
std::vector<string> v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <functional> | |
#include <fstream> | |
#include <iterator> | |
#include <iostream> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<student> extract_fails(vector<student> &sts) | |
{ | |
//vector<student> failed; | |
//remove_copy_if(sts.begin(), sts.end(), back_inserter(failed), | |
// [](student st){ return st.grade() >= 60; }); | |
//sts.erase(remove_if(sts.begin(), sts.end(), | |
// [](student st){ return st.grade() < 60; }), sts.end()); | |
vector<student>::iterator i = stable_partition(sts.begin(), sts.end(), | |
[](student st){ return st.grade() >= 60; }); | |
vector<student> failed(i, sts.end()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
#include <string> | |
#include <numeric> | |
#include <iostream> | |
using namespace std; | |
string cat(vector<string> v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <string> | |
#include <vector> | |
#include <fstream> | |
#include <iostream> | |
#include <sstream> | |
#include <iterator> | |
#include <algorithm> | |
#include <string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
#include <map> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <iterator> | |
#include <cassert> | |
#include <cstdlib> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
typedef vector<int>::iterator iter; | |
struct cmp | |
{ | |
int pivot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iterator> | |
#include <algorithm> | |
#include "student.h" | |
istream& operator >>(istream &is, vector<double> &v); | |
student read(istream &is) | |
{ | |
string name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file | |
* @author answeror <[email protected]> | |
* @date 2012-07-05 | |
* | |
* @section DESCRIPTION | |
* | |
* This file is used to illustrate how to do simple unit testing. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
#include <cctype> | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
using namespace std; | |
template<class Out> |
OlderNewer