Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

滕鎧泽的作业 #5

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

滕鎧泽的作业 #5

wants to merge 21 commits into from

Conversation

tengkaize
Copy link

@tengkaize tengkaize commented Sep 18, 2023

已完成 level1

@tengkaize tengkaize changed the title 滕鎧泽的 滕鎧泽的作业 Sep 18, 2023
return;
}
hanoi(n - 1, a, c, b);
printf("%c -> %c\n", a, c);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与第7行重复了,能否消除掉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void hanoi(int n, char a, char b, char c) {
	if (n == 0) return;
	hanoi(n - 1, a, c, b);
	printf("%c -> %c\n", a, c);
	hanoi(n - 1, b, a, c);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants