diff --git a/stdio.hpp b/stdio.hpp index 6cca73b47bd98827e6c7ea7037b9cdf23b0410da..cdc028a71cc9d577e2f17967ae4caaf87aed7575 100644 --- a/stdio.hpp +++ b/stdio.hpp @@ -67,6 +67,12 @@ namespace rlib { template <typename... Args> size_t printfln(std::ostream &os, const std::string &fmt, Args... args); + template <typename TargetType = std::string> + inline TargetType scan(std::istream &is = std::cin) { + TargetType target; + is >> target; + return target; + } inline rlib::string scanln(std::istream &is = std::cin, char delimiter = '\n') noexcept { std::string line; std::getline(is, line, delimiter);