mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-07 19:29:18 +00:00
quiz1 done
This commit is contained in:
parent
bae67e341a
commit
18509cba3f
@ -13,10 +13,17 @@
|
|||||||
//
|
//
|
||||||
// No hints this time ;)
|
// No hints this time ;)
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
// Put your function here!
|
// Put your function here!
|
||||||
// fn calculate_price_of_apples {
|
fn calculate_price_of_apples(apple: i32) -> i32{
|
||||||
|
let price: i32 = if apple > 40 {
|
||||||
|
apple * 1
|
||||||
|
} else {
|
||||||
|
apple * 2
|
||||||
|
};
|
||||||
|
price
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Don't modify this function!
|
// Don't modify this function!
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user