本文整理汇总了C++中vc::pop_back方法的典型用法代码示例。如果您正苦于以下问题:C++ vc::pop_back方法的具体用法?C++ vc::pop_back怎么用?C++ vc::pop_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vc
的用法示例。
在下文中一共展示了vc::pop_back方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check
char check(void){
while (mount.size()) {
if (mount[mount.size()-1] == lake[lake.size()-1]+1) {
lake.push_back(mount[mount.size()-1]);
mount.pop_back();
}
else if (branch.size()){
if (branch[branch.size()-1] == lake[lake.size()-1]+1) {
lake.push_back(branch[branch.size()-1]);
branch.pop_back();
}
else if (branch[branch.size()-1] < mount[mount.size()-1]){
return 'N';
}
else if (branch[branch.size()-1] > mount[mount.size()-1]){
branch.push_back(mount[mount.size()-1]);
mount.pop_back();
}
}
else {
branch.push_back(mount[mount.size()-1]);
mount.pop_back();
}
}
return 'Y';
}
示例2: recurse
void recurse(int num, string a, string b){
if (!u) {
return;
}
if (a == b && a != "") {
//cout << a << endl;
u=false;
cout << order.size() << endl;
for (int i = 0; i < order.size(); i++) {
cout << order[i] << endl;
}
return;
}
if (num >= m) {
return;
}
for (int i = 0; i < a1.size(); i++) {
string p = a + a1[i];
string q = b + b2[i];
int least = min(p.length(), q.length());
if (p.substr(0, least) == q.substr(0, least)) {
order.push_back(i+1);
recurse(num+1, p, q);
order.pop_back();
}
}
}
示例3: best
void best(int index, string a, string b, vc s, vector<bool> limits){
cout << "index: " << index << " a: " << a << " b: " << b<< " ";
for (int w = 0; w < s.size(); w++) {
cout << s[w];
}
cout << endl;
if (s.size() < lim) {
if (a == b) {
cout << "*************************************" <<endl;
bool p = true;
for (int j = 0; j < num; j++) {
if (limits[j] == false) {
p = false;
break;
}
}
if (p == true) {
cout << s.size() << endl;
for (int q = 0; q < s.size(); q++) {
cout << s[q] << endl;
}
return;
}
}
int jkl = 0;
for (int i = 0; i < min(a.length(), b.length()); i++) {
if (a[i] != b[i]) {
jkl++;
}
}
if (jkl == 0) {
for (int i = 0; i < num; i++) {
if (b == "abaaaaaa") {
cout << "yyyyyyyyyyyyyy" <<endl;
}
//cout << i <<endl;
s.push_back(i);
limits[i]= true;
a+=str[0][i];
b+=str[1][i];
if (a == "abaaaaaab" || b == "abaaaaaab")
cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%";
best(i, a, b, s, limits);
limits[i] = false;
s.pop_back();
}
}}
}
示例4: main
int main(void)
{
int num;
cin >> num;
for (int i = 0; i < num; i++) {
int temp;
cin >> temp;
if (temp == 0) {
list.pop_back();
}
else list.push_back(temp);
}
int sum = 0;
for (int i = 0; i < list.size(); i++) {
sum += list[i];
}
cout << sum;
}
示例5: main
int main(void)
{
moves[1] = "ABDE";
moves[2] = "ABC";
moves[3] = "BCEF";
moves[4] = "ADG";
moves[5] = "BDEFH";
moves[6] = "CFI";
moves[7] = "DEGH";
moves[8] = "GHI";
moves[9] = "EFHI";
clocks['A'] = 0;
clocks['B'] = 1;
clocks['C'] = 2;
clocks['D'] = 3;
clocks['E'] = 4;
clocks['F'] = 5;
clocks['G'] = 6;
clocks['H'] = 7;
clocks['I'] = 8;
for (int i = 1; i <= 9; i++) {
int temp;
cin >> temp;
//val[i] = temp;
list.push_back(temp);
//6,9,3,3,3,9,12,12,12, 12, 12, 12
//9,3,9,9,9,9,9,9,9,9,9,9
}
//cout << list[list.size()-3] << ',' << list[list.size()-2] << ','<< list[list.size()-1] << endl;
//return 0;
//cout << endl;
for (int i = 1; i <= 9; i++) {
if (u) {
break;
}
list.push_back(i);
addvals(list, "");
list.pop_back();
}
for (int i = 0; i < bfs.size(); i++) {
if (u) {
break;
}
//if (i < 10000) {
for (int k = 0; k < bfs[i].size(); k++) {
cout << bfs[i][k] << ",";
}
cout << endl;
//}
if(bfs[i].size())bfs[i].pop_back();
for (int j = 1; j <= 9 ; j++) {
if (u) {
break;
}
bfs[i].push_back(j);
addvals(bfs[i], ord[i]);
bfs[i].pop_back();
}
}
}