mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-28 23:09:18 +00:00
15 lines
264 B
Rust
15 lines
264 B
Rust
// functions5.rs
|
|
//
|
|
// 執行 `rustlings hint functions5` 或使用 `hint` watch 子命令來獲取提示。
|
|
|
|
// I AM NOT DONE
|
|
|
|
fn main() {
|
|
let answer = square(3);
|
|
println!("The square of 3 is {}", answer);
|
|
}
|
|
|
|
fn square(num: i32) -> i32 {
|
|
num * num;
|
|
}
|