Skip to content

Instantly share code, notes, and snippets.

@ampulhetadosaber
Created September 27, 2020 23:36
Show Gist options
  • Save ampulhetadosaber/02761d2edd9e897531478b50c7a112b4 to your computer and use it in GitHub Desktop.
Save ampulhetadosaber/02761d2edd9e897531478b50c7a112b4 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> V;
V.push_back(1);
V.push_back(2);
V.push_back(3);
V.push_back(4);
V.push_back(5);
// Removendo o primeiro elemento
for(int i = 0 ; i < (int)V.size() - 1 ; i++)
{
V[i] = V[i+1];
}
V.pop_back();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment