mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-07 03:09:19 +00:00
quizz1 done
This commit is contained in:
parent
b4635dcacd
commit
caac1b3bfa
@ -7,10 +7,13 @@
|
||||
// more than 40 at once, each apple only costs 1! Write a function that calculates
|
||||
// the price of an order of apples given the order amount. No hints this time!
|
||||
|
||||
// I AM NOT DONE
|
||||
fn calculate_apple_price(amount: i32) -> i32 {
|
||||
if(amount < 40){
|
||||
return amount * 2;
|
||||
}
|
||||
|
||||
// Put your function here!
|
||||
// fn ..... {
|
||||
return amount;
|
||||
}
|
||||
|
||||
// Don't modify this function!
|
||||
#[test]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user