hello,world!
This commit is contained in:
BIN
book/Rust 程序设计语言 简体中文版.pdf
Normal file
BIN
book/Rust 程序设计语言 简体中文版.pdf
Normal file
Binary file not shown.
7
code/world_hello/Cargo.lock
generated
Normal file
7
code/world_hello/Cargo.lock
generated
Normal file
@@ -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"
|
||||||
6
code/world_hello/Cargo.toml
Normal file
6
code/world_hello/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "world_hello"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
13
code/world_hello/src/main.rs
Normal file
13
code/world_hello/src/main.rs
Normal file
@@ -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();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user