Format C, C++, C#, Go, Java, Python, Rust code.

This commit is contained in:
krahets
2023-09-02 23:54:38 +08:00
parent b6ac6aa7d7
commit dd72335235
53 changed files with 152 additions and 154 deletions

View File

@@ -27,7 +27,7 @@ def dfs(i: int, src: list[int], buf: list[int], tar: list[int]):
dfs(i - 1, buf, src, tar)
def hanota(A: list[int], B: list[int], C: list[int]):
def solve_hanota(A: list[int], B: list[int], C: list[int]):
"""求解汉诺塔"""
n = len(A)
# 将 A 顶部 n 个圆盘借助 B 移到 C
@@ -45,7 +45,7 @@ if __name__ == "__main__":
print(f"B = {B}")
print(f"C = {C}")
hanota(A, B, C)
solve_hanota(A, B, C)
print("圆盘移动完成后:")
print(f"A = {A}")