We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a22ea1d commit 1f6e104Copy full SHA for 1f6e104
exercises/variables/variables4.rs
@@ -1,12 +1,10 @@
1
-// variables4.rs
2
-//
3
-// Execute `rustlings hint variables4` or use the `hint` watch subcommand for a
4
-// hint.
5
-
6
7
fn main() {
+ // 1. 声明可变变量x,绑定初始值3(mut关键字表示变量可修改)
8
let mut x = 3;
+ // 2. 打印初始值:输出 "Number 3"
9
println!("Number {}", x);
+ // 3. 修改可变变量x的值为5(只有mut变量才能重新赋值)
10
x = 5; // don't change this line
+ // 4. 打印修改后的值:输出 "Number 5"
11
12
}
0 commit comments