<\/span><\/h2>\n\n\n\nToday, we will learn about the Array<\/em> data structure.<\/p>\n\n\n\n<\/span>Task<\/strong><\/span><\/h2>\n\n\n\nGiven an array, A<\/em><\/strong>, of N<\/em><\/strong> integers, print A<\/em><\/strong>‘s elements in reverse<\/em> order as a single line of space-separated numbers.<\/p>\n\n\n\nExample<\/strong><\/p>\n\n\n\nA<\/em> = [1 ,2, 3, 4]<\/strong><\/p>\n\n\n\nPrint 4 3 2 1<\/code>. Each integer is separated by one space.<\/p>\n\n\n\n<\/span>Input Format<\/strong><\/span><\/h2>\n\n\n\nThe first line contains an integer, N<\/em><\/strong> (the size of our array).
The second line contains N<\/em><\/strong> space-separated integers that describe array A<\/em><\/strong>‘s elements.<\/p>\n\n\n\n<\/span>Constraints<\/strong><\/span><\/h2>\n\n\n\n- 1 <= N <= 1000<\/strong><\/li>
- 1 <= A<\/em>[i<\/em>] <= 10000<\/strong>, where A<\/em>[i<\/em>] <\/strong>is the ith<\/sup><\/em><\/strong> integer in the array.<\/li><\/ul>\n\n\n\n
<\/span>Output Format<\/strong><\/span><\/h2>\n\n\n\nPrint the elements of array A<\/em><\/strong> in reverse order as a single line of space-separated numbers.<\/p>\n\n\n\nSample Input<\/strong><\/p>\n\n\n\n4\n1 4 3 2<\/code><\/pre>\n\n\n\nSample Output<\/strong><\/p>\n\n\n\n2 3 4 1<\/code><\/pre>\n\n\n\n<\/span>Solution – Day 7: Arrays<\/strong><\/span><\/h2>\n\n\n\n<\/span>C++<\/strong><\/span><\/h3>\n\n\n\n#include <map>\n#include <set>\n#include <list>\n#include <cmath>\n#include <ctime>\n#include <deque>\n#include <queue>\n#include <stack>\n#include <string>\n#include <bitset>\n#include <cstdio>\n#include <limits>\n#include <vector>\n#include <climits>\n#include <cstring>\n#include <cstdlib>\n#include <fstream>\n#include <numeric>\n#include <sstream>\n#include <iostream>\n#include <algorithm>\n#include <unordered_map>\nusing namespace std;\n\/*\n *\n * Prosen Ghosh\n * American International University - Bangladesh (AIUB)\n *\n*\/\nint main(){\n int n;\n cin >> n;\n vector<int> arr(n);\n for(int arr_i = 0;arr_i < n;arr_i++){\n cin >> arr[arr_i];\n }\n for(int arr_i = n-1;arr_i >= 0;arr_i--){\n cout << arr[arr_i] << \" \";\n }\n cout << endl;\n return 0;\n}<\/pre>\n\n\n\n