control flpw

This commit is contained in:
Hariettemaina 2022-09-09 15:24:52 +03:00
parent 25673f002f
commit bad3f7c461
3 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,7 @@
// functions5.rs // functions5.rs
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a hint. // Execute `rustlings hint functions5` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
fn main() { fn main() {
let answer = square(3); let answer = square(3);

View File

@ -1,13 +1,18 @@
// if1.rs // if1.rs
// Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint. // Execute `rustlings hint if1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
pub fn bigger(a: i32, b: i32) -> i32 { pub fn bigger(a: i32, b: i32) -> i32 {
// Complete this function to return the bigger number! // Complete this function to return the bigger number!
// Do not use: // Do not use:
// - another function call // - another function call
// - additional variables // - additional variables
if a > b {
a
}else{
b
}
} }
// Don't mind this for now :) // Don't mind this for now :)

View File

@ -9,8 +9,10 @@
pub fn foo_if_fizz(fizzish: &str) -> &str { pub fn foo_if_fizz(fizzish: &str) -> &str {
if fizzish == "fizz" { if fizzish == "fizz" {
"foo" "foo"
} else if fizzish == "fuzz" {
"bar"
}else { }else {
1 "baz"
} }
} }