mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-17 17:26:06 +00:00
zig : update codes style && rust : add codes for chapter_backtracking. (#613)
* zig : update codes style * rust : add codes for chapter_backtracking * zig : update codes style
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
const std = @import("std");
|
||||
|
||||
// 带约束爬楼梯:动态规划
|
||||
fn climbing_stairs_constraint_dp(comptime n: usize) i32 {
|
||||
fn climbingStairsConstraintDP(comptime n: usize) i32 {
|
||||
if (n == 1 or n == 2) {
|
||||
return @intCast(n);
|
||||
}
|
||||
@@ -28,7 +28,7 @@ fn climbing_stairs_constraint_dp(comptime n: usize) i32 {
|
||||
pub fn main() !void {
|
||||
comptime var n: usize = 9;
|
||||
|
||||
var res = climbing_stairs_constraint_dp(n);
|
||||
var res = climbingStairsConstraintDP(n);
|
||||
std.debug.print("爬 {} 阶楼梯共有 {} 种方案\n", .{ n, res });
|
||||
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
|
||||
Reference in New Issue
Block a user