mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-11 03:10:58 +00:00
Finetune Rust code.
This commit is contained in:
@@ -51,4 +51,4 @@ fn main() {
|
||||
println!("\ncoins = {:?}, amt = {}", coins, amt);
|
||||
println!("凑到 {} 所需的最少硬币数量为 {}", amt, res);
|
||||
println!("实际上需要的最少数量为 2 ,即 49 + 49");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,4 +56,4 @@ fn main() {
|
||||
// 贪心算法
|
||||
let res = fractional_knapsack(&wgt, &val, cap);
|
||||
println!("不超过背包容量的最大物品价值为 {}", res);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,4 @@ fn main() {
|
||||
// 贪心算法
|
||||
let res = max_capacity(&ht);
|
||||
println!("最大容量为 {}", res);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user