mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 13:19:18 +00:00
varialbes clear
This commit is contained in:
parent
30b4480ca3
commit
4188ca26a7
@ -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.
|
You can make them mutable by adding mut in front of the variable name.
|
||||||
|
|
||||||
## Further information
|
## Further information
|
||||||
|
tt
|
||||||
- [Variables and Mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html)
|
- [Variables and Mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html)
|
||||||
|
|||||||
@ -9,6 +9,6 @@
|
|||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 5;
|
let x = 7;
|
||||||
println!("x has the value {}", x);
|
println!("x has the value {}", x);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 3;
|
let mut x = 3;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
x = 5; // don't change this line
|
x = 5; // don't change this line
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
|
|||||||
@ -4,6 +4,6 @@
|
|||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: i32;
|
let x: i32=50;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,6 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let number = "T-H-R-E-E"; // don't change this line
|
let number = "T-H-R-E-E"; // don't change this line
|
||||||
println!("Spell a Number : {}", number);
|
println!("Spell a Number : {}", number);
|
||||||
number = 3;
|
let number=3;
|
||||||
println!("Number plus two is : {}", number + 2);
|
println!("Number plus two is : {}", number + 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,9 @@
|
|||||||
/*
|
/*
|
||||||
I AM NOT DONE
|
I AM NOT DONE
|
||||||
*/
|
*/
|
||||||
const NUMBER=1;
|
const NUMBER:i32 =1;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Number {}", NUMBER);
|
println!("Number {}", NUMBER);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user