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

@@ -28,7 +28,7 @@ function dfs(i, src, buf, tar) {
}
/* 求解汉诺塔 */
function hanota(A, B, C) {
function solveHanota(A, B, C) {
const n = A.length;
// 将 A 顶部 n 个圆盘借助 B 移到 C
dfs(n, A, B, C);
@@ -44,7 +44,7 @@ console.log(`A = ${JSON.stringify(A)}`);
console.log(`B = ${JSON.stringify(B)}`);
console.log(`C = ${JSON.stringify(C)}`);
hanota(A, B, C);
solveHanota(A, B, C);
console.log('圆盘移动完成后:');
console.log(`A = ${JSON.stringify(A)}`);