Skip to content

Serohin serhii hw 02#39

Open
sserohin wants to merge 13 commits intomainfrom
Serohin_Serhii_HW_02
Open

Serohin serhii hw 02#39
sserohin wants to merge 13 commits intomainfrom
Serohin_Serhii_HW_02

Conversation

@sserohin
Copy link
Collaborator

@sserohin sserohin commented Nov 5, 2020

No description provided.

#include <iostream>

uint32_t value_digits_quantity(uint32_t value);
uint32_t value_summ_digits(uint32_t value);
Copy link
Owner

Choose a reason for hiding this comment

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

а зачем тут делать обьявление а внизу определение?
почему тут сразу не писать определение?

* @return uint32_t Quantity of digits
*/
uint32_t value_digits_quantity(uint32_t value) {
uint32_t quantity = 1;
Copy link
Owner

Choose a reason for hiding this comment

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

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) {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
for (; value; value /= 10) {
while ((value /= 10) > 0) {

@@ -0,0 +1,59 @@
#include <cstdint>
#include <cstdlib>
Copy link
Owner

Choose a reason for hiding this comment

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

а зачем этот заголовочный файл?

@@ -0,0 +1,125 @@
#include <bits/c++config.h>
#include <bits/stdint-uintn.h>
Copy link
Owner

Choose a reason for hiding this comment

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

это за такие магические заголовочные файлы?

auto devider{value};

while (value % --devider) {
}
Copy link
Owner

Choose a reason for hiding this comment

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

неа) я думаю вам стоит лучше прочитать задание)

@@ -0,0 +1,64 @@
#include <bits/stdint-uintn.h>
Copy link
Owner

Choose a reason for hiding this comment

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

что это за инклуд?

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <ostream>
Copy link
Owner

Choose a reason for hiding this comment

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

это и правда вам надо столько инклудов подключать?

* @return true
* @return false
*/
inline bool is_even(int value) { return (value % 2 == 0); } No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

inline в данном случае это бесполезная штука

std::cout << "-->";
std::cin >> value;

if (!value_dec_2_bin(value, BIT_MASK, BIT_MASK_SIZE)) {
Copy link
Owner

Choose a reason for hiding this comment

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

в чем смысл делать эту функцию как bool?

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