Link Search Menu Expand Document
あるまかんライブラリ

:heavy_check_mark: read() (n個入力してContainerに格納して返す)
(Util/IO/read.hpp)

Required by

Verified with

Code

#pragma once
#include <iostream>
#include <vector>

/**
 * @brief read() (n個入力してContainerに格納して返す)
 */
template <class T = int, template <class, class...> class Container = std::vector>
Container<T> read(size_t n) {
    Container<T> ret(n);
    for (auto& e : ret) std::cin >> e;
    return ret;
}
#line 2 "Util/IO/read.hpp"
#include <iostream>
#include <vector>

/**
 * @brief read() (n個入力してContainerに格納して返す)
 */
template <class T = int, template <class, class...> class Container = std::vector>
Container<T> read(size_t n) {
    Container<T> ret(n);
    for (auto& e : ret) std::cin >> e;
    return ret;
}
Back to top page