mirror of https://github.com/sunface/rust-course
parent
718c89ea91
commit
b5216178fd
@ -1,13 +1,14 @@
|
||||
// variables2.rs
|
||||
// Make me compile! Execute the command `rustlings hint variables2` if you want a hint :)
|
||||
// 让我能够编译!执行 `rustex hint variables2` 获取提示 :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
/// 翻译: [mg-chao](https://github.com/mg-chao)
|
||||
fn main() {
|
||||
let x;
|
||||
if x == 10 {
|
||||
println!("Ten!");
|
||||
println!("Ten!");// 译:十!
|
||||
} else {
|
||||
println!("Not ten!");
|
||||
println!("Not ten!");// 译:不是十!
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
// variables3.rs
|
||||
// Make me compile! Execute the command `rustlings hint variables3` if you want a hint :)
|
||||
// 让我能够编译!执行 `rustex hint variables3` 获取提示 :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let x = 3;
|
||||
println!("Number {}", x);
|
||||
x = 5; // don't change this line
|
||||
println!("Number {}", x);// 译:"数字 {}"
|
||||
x = 5; // don't change this line(译:不要更改这一行)
|
||||
println!("Number {}", x);
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
// variables5.rs
|
||||
// Make me compile! Execute the command `rustlings hint variables5` if you want a hint :)
|
||||
// 让我能够编译!执行 `rustex hint variables5` 获取提示 :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let number = "T-H-R-E-E"; // don't change this line
|
||||
println!("Spell a Number : {}", number);
|
||||
println!("Spell a Number : {}", number);// 译:"拼接的数字:{}"
|
||||
number = 3;
|
||||
println!("Number plus two is : {}", number + 2);
|
||||
println!("Number plus two is : {}", number + 2);// 译:"数字加上二是:{}"
|
||||
}
|
||||
|
Loading…
Reference in new issue