diff --git a/exercises/variables/README.md b/exercises/variables/README.md index 11a7a78a..5051be50 100644 --- a/exercises/variables/README.md +++ b/exercises/variables/README.md @@ -5,5 +5,5 @@ When a variable is immutable, once a value is bound to a name, you can’t chang You can make them mutable by adding mut in front of the variable name. ## Further information - +tt - [Variables and Mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html) diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index 8734065c..0635e8eb 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -9,6 +9,6 @@ // I AM NOT DONE fn main() { - let x = 5; + let x = 7; println!("x has the value {}", x); } diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 30ec48ff..1f13bdad 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -4,7 +4,7 @@ // I AM NOT DONE fn main() { - let x = 3; + let mut x = 3; println!("Number {}", x); x = 5; // don't change this line println!("Number {}", x); diff --git a/exercises/variables/variables4.rs b/exercises/variables/variables4.rs index 77f1e9ab..c3d76e3d 100644 --- a/exercises/variables/variables4.rs +++ b/exercises/variables/variables4.rs @@ -4,6 +4,6 @@ // I AM NOT DONE fn main() { - let x: i32; + let x: i32=50; println!("Number {}", x); } diff --git a/exercises/variables/variables5.rs b/exercises/variables/variables5.rs index 175eebb3..1ec1190b 100644 --- a/exercises/variables/variables5.rs +++ b/exercises/variables/variables5.rs @@ -6,6 +6,6 @@ fn main() { let number = "T-H-R-E-E"; // don't change this line println!("Spell a Number : {}", number); - number = 3; + let number=3; println!("Number plus two is : {}", number + 2); } diff --git a/exercises/variables/variables6.rs b/exercises/variables/variables6.rs index 3116fc03..e2e708c0 100644 --- a/exercises/variables/variables6.rs +++ b/exercises/variables/variables6.rs @@ -4,8 +4,9 @@ /* I AM NOT DONE */ -const NUMBER=1; +const NUMBER:i32 =1; fn main() { println!("Number {}", NUMBER); + }