diff --git a/print.cpp b/print.cpp new file mode 100644 index 0000000..75ff3dc --- /dev/null +++ b/print.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include + +namespace fs = std::filesystem; + +int main() { + fs::path current_path = fs:: + fs::path file_path = current_path / "找找自己問題.txt"; + + std::ifstream file(file_path); + if (file.is_open()) { + std::string line; + while (std::getline(file, line)) { + std::cout << line << std::endl; + } + file.close(); + } else { + std::cerr << "無法開啟檔案: " << file_path << std::endl; + } + + return 0; +}