Merge 88086d6b9c
into b5bbd7247a
This commit is contained in:
commit
b842030887
|
@ -4,7 +4,9 @@ fn main() {
|
||||||
call_me();
|
call_me();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn call_me() {
|
||||||
|
println!("thank you for calling me :)");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ fn main() {
|
||||||
call_me(3);
|
call_me(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_me(num) {
|
fn call_me(num: i32) {
|
||||||
for i in 0..num {
|
for i in 0..num {
|
||||||
println!("Ring! Call number {}", i + 1);
|
println!("Ring! Call number {}", i + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
call_me();
|
call_me(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_me(num: i32) {
|
fn call_me(num: i32) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ fn main() {
|
||||||
println!("Your sale price is {}", sale_price(original_price));
|
println!("Your sale price is {}", sale_price(original_price));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sale_price(price: i32) -> {
|
fn sale_price(price: i32) -> i32 {
|
||||||
if is_even(price) {
|
if is_even(price) {
|
||||||
price - 10
|
price - 10
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -6,7 +6,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn square(num: i32) -> i32 {
|
fn square(num: i32) -> i32 {
|
||||||
num * num;
|
num * num
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
x = 5;
|
let x = 5;
|
||||||
println!("x has the value {}", x);
|
println!("x has the value {}", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x;
|
let x = 10;
|
||||||
if x == 10 {
|
if x == 10 {
|
||||||
println!("Ten!");
|
println!("Ten!");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 3;
|
let mut x = 3;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
x = 5;
|
x = 5;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: i32;
|
let x: i32 = 777;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue