mirror of
https://github.com/ChenKaiLiuG/find_your_own_fxxking_problem.git
synced 2026-06-17 16:54:24 +00:00
Move print.cpp to directory /run
This commit is contained in:
25
run/print.cpp
Normal file
25
run/print.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Under debugging because of general physic
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user