本文整理汇总了C++中vs::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ vs::push_back方法的具体用法?C++ vs::push_back怎么用?C++ vs::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs
的用法示例。
在下文中一共展示了vs::push_back方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildPath
void BuildPath(map<string, vs> &traces, vvs &pathes, vs &path, string word, string start){
if(word == start){
path.push_back(word);
vs tmp = path;
reverse(tmp.begin(), tmp.end());
pathes.push_back(tmp);
path.pop_back();
return;
}
path.push_back(word);
vs tmp = traces[word];
for(int i = 0; i < tmp.size(); ++i)
BuildPath(traces, pathes, path, tmp[i], start);
path.pop_back();
}
示例2: worker
void worker(vs &ret, int level, int pos, string s) {
if(level == 3) {
if(s.size() - pos > 3) return;
else {
string t = s.substr(pos, 3);
if(t[0] == '0' && t.size() != 1) return;
if(stoi(t) <= 255) {
ret.push_back(s);
}
}
return;
}
if(s[pos] == '0') {
string temp = s;
if(pos + 1 >= s.size()) return;
temp.insert(pos + 1, 1, '.');
worker(ret, level + 1, pos + 2, temp);
return;
}
for(int i = pos; i < pos + 3; ++i) {
if(i == pos + 2) {
if(stoi(s.substr(pos, 3)) > 255) {
continue;
}
}
string temp = s;
if(i + 1 >= s.size()) return;
temp.insert(i + 1, 1, '.');
worker(ret, level + 1, i + 2, temp);
}
}
示例3: format_data
//SBSI has members h, wc, bsa and vtc.
vs* format_data(double data[][5])
{
static vs output;
for(int i = 0;
data[i][0] != 0
|| data[i][1] != 0
|| data[i][2] != 0
|| data[i][3] != 0
|| data[i][4] != 0;
i++){
string* tmp = new SBSI;
tmp->h = data[i][0];
tmp->wc = data[i][1];
tmp->bsa = data[i][2];
tmp->vtc = data[i][3];
tmp->expected = data[i][4];
output.push_back(tmp);
//cout << "Pushed back " << output[i]->h << endl;
}
return &output;
/* char* p1 = data;
char* p2 = p1;
int n = 0;
int counter = 0, length = 0;
while ( p1[0] != '\0') {
SBSI temp;
while ( p1[0] != ',') {
while(!isalpha(p1[0]))
++p1;
p2 = p1+1;
while(*p2 != '\0') {
if(*p2 == '\t')
length++;
break; //Element delimiter.
}
}
}
*/
}
示例4: add
void add (int si, int fi, int sj, int fj)
{
string t;
temp.clear();
for (int i = si; i < fi; i++){
for (int j = sj; j < fj; j++)
{
t.push_back(b[i][j]);
}
temp.push_back(t);
}
if (SET.find(temp) == SET.end())
SET.insert(temp);
else
{
fail = 1;
return;
}
for (int i = )
}
示例5: main
int main(int argc, char const *argv[]) {
lli n,m;
cin >> n >> m;
for (lli i = 0; i < n; ++i) {
string s;
cin >> s;
vec.push_back(s);
}
for (lli i = 0; i < m; ++i) {
string s;
cin >> s;
ib result = binary_search(0, n, s);
string say = (result.second) ? "SIM" : "NAO";
cout << say << " " << result.first << endl;
comps = 0;
if(i == 6) break;
}
// cout << lessThan("alg","a") << endl;
// cout << comps << endl;
return 0;
}
示例6: addFunctionUse
void addFunctionUse(string fun_name) {
if (!containsElem(function_uses, fun_name)){
function_uses.push_back(fun_name);
}
}