This commit is contained in:
TimLai666 2024-06-10 16:23:22 +08:00 committed by GitHub
parent a4d9df1ad0
commit 0f30af3e3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 22 additions and 25 deletions

View File

@ -13,8 +13,8 @@
// I AM NOT DONE
fn main() {
println!("Hello and");
println!(r#" welcome to... "#);
println!("您好,");
println!(r#" 歡迎來到... "#);
println!(r#" _ _ _ "#);
println!(r#" _ __ _ _ ___| |_| (_)_ __ __ _ ___ "#);
println!(r#" | '__| | | / __| __| | | '_ \ / _` / __| "#);
@ -22,17 +22,14 @@ fn main() {
println!(r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "#);
println!(r#" |___/ "#);
println!();
println!("This exercise compiles successfully. The remaining exercises contain a compiler");
println!("or logic error. The central concept behind Rustlings is to fix these errors and");
println!("solve the exercises. Good luck!");
println!("此練習已成功編譯。其餘練習包含編譯或邏輯錯誤。Rustlings 的核心概念是修復這些錯誤並解決練習。祝您好運!");
println!();
println!("The source for this exercise is in `exercises/00_intro/intro1.rs`. Have a look!");
println!(
"Going forward, the source of the exercises will always be in the success/failure output."
);
println!("此練習的源碼在 `exercises/00_intro/intro1.rs`。請查看!");
println!("之後,每個練習的源碼路徑將會顯示在成功或失敗的輸出結果中。");
println!();
println!(
"If you want to use rust-analyzer, Rust's LSP implementation, make sure your editor is set"
"如果您想使用 Rust 的 LSP 實現 rust-analyzer請確保您的編輯器已設置"
);
println!("up, and then run `rustlings lsp` before continuing.")
println!("然後在繼續之前運行 `rustlings lsp`。")
}

View File

@ -7,5 +7,5 @@
// I AM NOT DONE
fn main() {
printline!("Hello there!")
printline!("你好!")
}

View File

@ -8,5 +8,5 @@
fn main() {
x = 5;
println!("x has the value {}", x);
println!("x 的值: {}", x);
}

View File

@ -7,8 +7,8 @@
fn main() {
let x;
if x == 10 {
println!("x is ten!");
println!("x 是十!");
} else {
println!("x is not ten!");
println!("x 不是十!");
}
}

View File

@ -6,5 +6,5 @@
fn main() {
let x: i32;
println!("Number {}", x);
println!("數字 {}", x);
}

View File

@ -6,7 +6,7 @@
fn main() {
let x = 3;
println!("Number {}", x);
x = 5; // don't change this line
println!("Number {}", x);
println!("數字 {}", x);
x = 5; // 不要改這一行
println!("數字 {}", x);
}

View File

@ -5,8 +5,8 @@
// I AM NOT DONE
fn main() {
let number = "T-H-R-E-E"; // don't change this line
let number = "T-H-R-E-E"; // 不要改這一行
println!("Spell a Number : {}", number);
number = 3; // don't rename this variable
number = 3; // 不要重命名這個變數
println!("Number plus two is : {}", number + 2);
}

View File

@ -10,6 +10,6 @@ fn main() {
fn call_me(num:) {
for i in 0..num {
println!("Ring! Call number {}", i + 1);
println!("鈴鈴!第 {} 次呼叫", i + 1);
}
}

View File

@ -10,6 +10,6 @@ fn main() {
fn call_me(num: u32) {
for i in 0..num {
println!("Ring! Call number {}", i + 1);
println!("鈴鈴!第 {} 次呼叫", i + 1);
}
}

View File

@ -10,7 +10,7 @@
fn main() {
let original_price = 51;
println!("Your sale price is {}", sale_price(original_price));
println!("您的售價是 {}", sale_price(original_price));
}
fn sale_price(price: i32) -> {

View File

@ -6,7 +6,7 @@
fn main() {
let answer = square(3);
println!("The square of 3 is {}", answer);
println!("3 的平方是 {}", answer);
}
fn square(num: i32) -> i32 {