Skip to content

Instantly share code, notes, and snippets.

@Thiago4532
Created May 21, 2019 22:11
Show Gist options
  • Save Thiago4532/da6e387ff4d60d587156dfb9fbb6fe35 to your computer and use it in GitHub Desktop.
Save Thiago4532/da6e387ff4d60d587156dfb9fbb6fe35 to your computer and use it in GitHub Desktop.
#include <vector> // Biblioteca que contem a estrutura vector
using namespace std;
int main() {
vector<int> v; // Declaracao de um vector do tipo int
// No inicio o vetor esta vazio
v.push_back(1); // Insiro o elemento 1 no final do vetor
v.push_back(3); // Insiro o elemento 3 no final do vetor
v.push_back(5); // Insiro o elemento 5 no final do vetor
v.push_back(7); // Insiro o elemento 7 no final do vetor
// O vetor final é {1, 3, 5, 7}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment