Open
Conversation
| #include <iostream> | ||
|
|
||
| uint32_t value_digits_quantity(uint32_t value); | ||
| uint32_t value_summ_digits(uint32_t value); |
Owner
There was a problem hiding this comment.
а зачем тут делать обьявление а внизу определение?
почему тут сразу не писать определение?
| * @return uint32_t Quantity of digits | ||
| */ | ||
| uint32_t value_digits_quantity(uint32_t value) { | ||
| uint32_t quantity = 1; |
Owner
There was a problem hiding this comment.
Suggested change
| uint32_t quantity = 1; | |
| uint32_t quantity{1}; |
| uint32_t value_summ_digits(uint32_t value) { | ||
| uint32_t summ = 0; | ||
|
|
||
| for (; value; value /= 10) { |
Owner
There was a problem hiding this comment.
Suggested change
| for (; value; value /= 10) { | |
| while ((value /= 10) > 0) { |
| @@ -0,0 +1,59 @@ | |||
| #include <cstdint> | |||
| #include <cstdlib> | |||
Owner
There was a problem hiding this comment.
а зачем этот заголовочный файл?
| @@ -0,0 +1,125 @@ | |||
| #include <bits/c++config.h> | |||
| #include <bits/stdint-uintn.h> | |||
Owner
There was a problem hiding this comment.
это за такие магические заголовочные файлы?
| auto devider{value}; | ||
|
|
||
| while (value % --devider) { | ||
| } |
Owner
There was a problem hiding this comment.
неа) я думаю вам стоит лучше прочитать задание)
| @@ -0,0 +1,64 @@ | |||
| #include <bits/stdint-uintn.h> | |||
| #include <cstdio> | ||
| #include <cstdlib> | ||
| #include <iostream> | ||
| #include <ostream> |
Owner
There was a problem hiding this comment.
это и правда вам надо столько инклудов подключать?
| * @return true | ||
| * @return false | ||
| */ | ||
| inline bool is_even(int value) { return (value % 2 == 0); } No newline at end of file |
Owner
There was a problem hiding this comment.
inline в данном случае это бесполезная штука
| std::cout << "-->"; | ||
| std::cin >> value; | ||
|
|
||
| if (!value_dec_2_bin(value, BIT_MASK, BIT_MASK_SIZE)) { |
Owner
There was a problem hiding this comment.
в чем смысл делать эту функцию как bool?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.