From 80e633fa0428d5517e1cf338fd871dba00edd067 Mon Sep 17 00:00:00 2001 From: ChenKaiLiuG <141424456+ChenKaiLiuG@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:46:45 +0800 Subject: [PATCH] Create print.rs --- print.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 print.rs diff --git a/print.rs b/print.rs new file mode 100644 index 0000000..4acf127 --- /dev/null +++ b/print.rs @@ -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(()) +}