mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2025-02-25 02:30:35 +08:00
10 lines
121 B
Rust
10 lines
121 B
Rust
fn main() {
|
|
let x = plus_one(-1);
|
|
|
|
println! ("x 的值为:{}", x);
|
|
}
|
|
|
|
fn plus_one(x: i32) -> i32 {
|
|
x + 1
|
|
}
|