You are viewing a single comment's thread. Return to all comments →
I'm trying to get better with the STL. Here's what I came up with. I just ignored the first line of input.
#include <vector> #include <iostream> #include <algorithm> #include <iterator> int main() { std::cin.ignore(256, '\n'); std::vector<int> v; std::copy(std::istream_iterator<int> (std::cin), std::istream_iterator<int> (), back_inserter(v)); std::copy(v.rbegin(), v.rend(), std::ostream_iterator<int> (std::cout, " ")); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
I'm trying to get better with the STL. Here's what I came up with. I just ignored the first line of input.