Saturday, 1 April 2017

Hacker Rank Solution Program In C++ For " Day 7: Arrays "

Problem :- Day 7: Arrays

Submit Your Solution Here :- Click Here

Copy The Color Code and paste it into hackerrank Editor .

Solution :-

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>

using namespace std;


int main(){
    int n;
    cin >> n;
    vector<int> arr(n);
    for(int arr_i = 0;arr_i < n;arr_i++){
       cin >> arr[arr_i];
    }
    for(int arr_i = n-1;arr_i >= 0;arr_i--){
       cout << arr[arr_i]<<" ";
    }
    return 0;
}

Output :-

Hacker Rank Solution Program In C++ For " Day 7: Arrays "

No comments:
Write comments

Recommended Posts × +