Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to fill vector from inputs c++

#include <iostream>
#include <vector>
using namespace std;

int main()
{
  vector<int> a;
  int SIZE = 5;
  
  for(int i = 0; i < N; i++)
  {
    int tmp;
    cin >> tmp;
    a[i] = tmp;
  }
}
 
PREVIOUS NEXT
Tagged: #fill #vector #inputs
ADD COMMENT
Topic
Name
4+2 =