Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to scan vector in c++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int k,size;
  cin>>size;
  vector<int>v;
  for(int i = 0;i<size;i++{
    cin>>k;
    v.push_back(k);
  }
      for(auto element:v){
        cout<<element<<" ";
      }
      return 0;
      }
Comment

PREVIOUS NEXT
Code Example
Cpp :: Code debut C++ 
Cpp :: c++ file handiling 
Cpp :: 1822. Sign of the Product of an Array leetcode in c++ 
Cpp :: How do you count the occurrence of a given character in a string? c++ 
Cpp :: how to use printf with <cinttypes c++ 
Cpp :: c++ graphics online compiler 
Cpp :: c++ break statement 
Cpp :: cplusplusbtutotrail 
Cpp :: error c4001 site:docs.microsoft.com 
Cpp :: adding two dates using necessary member function in c++ 
Cpp :: how to code a game in c++ 
Cpp :: convert c++ to c online 
Cpp :: How To Calculate 1+1 in c++ 
Cpp :: coin change top-down 
Cpp :: viewlist exaple win32 
Cpp :: passing reference to thread c++ 
Cpp :: what do I return in int main() function c++ 
Cpp :: Polycarp found a rectangular table consisting of n rows and m columns. He noticed that each cell of the table has its number, obtained by the following algorithm "by columns": codeforces solution 
Cpp :: facade pattern C++ code 
Cpp :: get shape of eigen matrix 
Cpp :: deliberation meaning 
Cpp :: segment tree lazy propogation 
Cpp :: For auto map C 
Cpp :: friend class in c++ 
Cpp :: Extended Euclid Algorithm Recursive Solution 
Cpp :: c++ copy with transform 
Cpp :: How to make an array dynamically using pointers 
Cpp :: catalan numbers c++ 
Cpp :: asio broadcast permission 
Cpp :: c++ loop 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =