Skip to content

greedy/max_capacity: fix myMax algorithm error#1784

Merged
krahets merged 1 commit intokrahets:mainfrom
realwujing:greedy
Jul 21, 2025
Merged

greedy/max_capacity: fix myMax algorithm error#1784
krahets merged 1 commit intokrahets:mainfrom
realwujing:greedy

Conversation

@realwujing
Copy link
Contributor

If this pull request (PR) pertains to Chinese-to-English translation, please confirm that you have read the contribution guidelines and complete the checklist below:

  • This PR represents the translation of a single, complete document, or contains only bug fixes.
  • The translation accurately conveys the original meaning and intent of the Chinese version. If deviations exist, I have provided explanatory comments to clarify the reasons.

If this pull request (PR) is associated with coding or code transpilation, please attach the relevant console outputs to the PR and complete the following checklist:

  • I have thoroughly reviewed the code, focusing on its formatting, comments, indentation, and file headers.
  • I have confirmed that the code execution outputs are consistent with those produced by the reference code (Python or Java).
  • The code is designed to be compatible on standard operating systems, including Windows, macOS, and Ubuntu.

@krahets
Copy link
Owner

krahets commented Jul 20, 2025

Hi, please show your test results and analysis to demonstrate the code bug.

@realwujing
Copy link
Contributor Author

Hi, please show your test results and analysis to demonstrate the code bug.

wujing@debian:~/code/hello-algo/codes/c/chapter_greedy$ diff -w max_capacity.c max_capacity1.c
1,6d0
< /**
< * File: max_capacity.c
< * Created Time: 2023-09-15
< * Author: xianii (xianyi.xia@outlook.com)
< */
<
12a7

15c10
< return a < b ? a : b;

  return a > b ? a : b;

wujing@debian:/code/hello-algo/codes/c/chapter_greedy$ ./max_capacity
最大容量为 0
wujing@debian:
/code/hello-algo/codes/c/chapter_greedy$ ./max_capacity1
最大容量为 28

Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@krahets krahets added bug Bug fixes code Code-related labels Jul 21, 2025
@krahets krahets merged commit 83a806a into krahets:main Jul 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fixes code Code-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants