Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class Is>
- std::vector<int> read(Is&& is) {
- int n = 0;
- is >> n;
- std::vector<int> v(n);
- for (auto& e : v) {
- is >> e;
- }
- return v;
- }
- void foo() {
- const auto v = read(std::cin);
- // const auto v = read(std::ifstream("input.txt"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement