trpl-zh-cn/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs
2022-02-06 16:43:51 +08:00

13 lines
193 B
Rust
Executable File

fn main() {
let x = 5;
let x = x + 1;
{
let x = x * 2;
println!("The value of x in the inner scope is: {}", x);
}
println!("The value of x is: {}", x);
}