mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-09 04:09:20 +00:00
commit
550c2f2674
@ -3,13 +3,13 @@
|
|||||||
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a
|
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a
|
||||||
// hint.
|
// hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let answer = square(3);
|
let answer:i32 = square(3);
|
||||||
println!("The square of 3 is {}", answer);
|
println!("The square of 3 is {}", answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn square(num: i32) -> i32 {
|
fn square(num: i32) -> i32 {
|
||||||
num * num;
|
(num * num)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user