diff --git a/book/Rust 程序设计语言 简体中文版.pdf b/book/Rust 程序设计语言 简体中文版.pdf new file mode 100644 index 0000000..6010030 Binary files /dev/null and b/book/Rust 程序设计语言 简体中文版.pdf differ diff --git a/code/world_hello/Cargo.lock b/code/world_hello/Cargo.lock new file mode 100644 index 0000000..2412271 --- /dev/null +++ b/code/world_hello/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "world_hello" +version = "0.1.0" diff --git a/code/world_hello/Cargo.toml b/code/world_hello/Cargo.toml new file mode 100644 index 0000000..ea79d1a --- /dev/null +++ b/code/world_hello/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "world_hello" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/code/world_hello/src/main.rs b/code/world_hello/src/main.rs new file mode 100644 index 0000000..5ff9e87 --- /dev/null +++ b/code/world_hello/src/main.rs @@ -0,0 +1,13 @@ +fn greet_world() { + let southern_germany = "Grüß Gott!"; + let chinese = "世界,你好"; + let english = "World, hello"; + let regions = [southern_germany, chinese, english]; + for region in regions.iter() { + println!("{}", ®ion); + } +} + +fn main() { + greet_world(); +} \ No newline at end of file