1.输出“输入的内容”
// basic file operations #include <iostream> #include <fstream> #include <string> using namespace std; std::istream& func(std::istream &is) { std::string buf; while (is >> buf) std::cout << "output = " << buf << std::endl; is.clear(); return is; } int main() { std::istream &is=cin; func(is); }
时间: 2024-10-28 15:30:58