mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-28 06:49:19 +00:00
variables exercises
This commit is contained in:
parent
244a0816ac
commit
8cc68ff891
@ -2,7 +2,7 @@
|
||||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
x = 5;
|
||||
let x = 5;
|
||||
println!("x has the value {}", x);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
let x;
|
||||
let x = 5;
|
||||
if x == 10 {
|
||||
println!("Ten!");
|
||||
} else {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
let x = 3;
|
||||
let mut x = 3;
|
||||
println!("Number {}", x);
|
||||
x = 5;
|
||||
println!("Number {}", x);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Make me compile! Scroll down for hints :)
|
||||
|
||||
fn main() {
|
||||
let x: i32;
|
||||
let x: i32 = 5;
|
||||
println!("Number {}", x);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user