Create print.rs

This commit is contained in:
ChenKaiLiuG
2025-04-02 20:46:45 +08:00
committed by GitHub
parent 9e164b326b
commit 80e633fa04

17
print.rs Normal file
View File

@@ -0,0 +1,17 @@
use std::fs;
use std::io;
fn main() -> io::Result<()> {
let filename = "找找自己問題.txt";
match fs::read_to_string(filename) {
Ok(contents) => {
println!("{}", contents);
}
Err(e) => {
eprintln!("無法讀取檔案 '{}': {}", filename, e);
}
}
Ok(())
}