mirror of https://github.com/sunface/rust-course
Merge pull request #110 from mg-chao/20220101_variables
[rust-exercise] 翻译 variables 部分pull/126/head
commit
4a86caa19a
@ -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,12 @@
|
||||
// variables3.rs
|
||||
// Make me compile! Execute the command `rustlings hint variables3` if you want a hint :)
|
||||
// 让我能够编译!执行 `rustex hint variables3` 获取提示 :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
/// 翻译: [mg-chao](https://github.com/mg-chao)
|
||||
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,12 @@
|
||||
// variables5.rs
|
||||
// Make me compile! Execute the command `rustlings hint variables5` if you want a hint :)
|
||||
// 让我能够编译!执行 `rustex hint variables5` 获取提示 :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
/// 翻译: [mg-chao](https://github.com/mg-chao)
|
||||
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