diff options
| author | Bond_009 <bond.009@outlook.com> | 2020-12-09 11:54:56 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-12-09 11:55:11 +0100 |
| commit | 2f29af718b7cf4e769cfb3fc351054453d193c42 (patch) | |
| tree | 1249b010c070a58fa121db62724c27e5494469af /9 | |
| parent | 6ee8e076d0b8630c4d78e7e88f1e44f5c7ba3854 (diff) | |
Minor improvements
Diffstat (limited to '9')
| -rw-r--r-- | 9/part2.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -49,7 +49,7 @@ int exe_program(const char *filename) cur_num = nums; do { - uint64_t min = __LONG_LONG_MAX__; + uint64_t min = __UINT64_MAX__; uint64_t max = 0; uint64_t sum = 0; uint64_t *p1 = cur_num; @@ -57,8 +57,7 @@ int exe_program(const char *filename) if (*p1 < min) { min = *p1; } - - if (*p1 > max) { + else if (*p1 > max) { max = *p1; } |
