Arrays Introduction

  • + 0 comments

    Cool C++ Solution

    #include <cmath>
    #include <cstdio>
    #include <vector>
    #include <iostream>
    #include <algorithm>
    using namespace std;
    
    
    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */
        int n;
        cin>>n;
        vector<int> vec(n,0);
        while(n--)cin>>vec[n];
        for(int x=0; x<vec.size(); x++)cout<<vec[x]<<" ";
        return 0;
    }