mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-07 19:29:18 +00:00
Exercise 13
This commit is contained in:
parent
7b53c94328
commit
1aed8d48f6
@ -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