Skip to content

Serohin serhii hw 02 - #39

Open
sserohin wants to merge 13 commits into
mainfrom
Serohin_Serhii_HW_02
Open

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

Conversation

@sserohin

@sserohin sserohin commented Nov 5, 2020

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread HW_02_01.cpp
#include <iostream>

uint32_t value_digits_quantity(uint32_t value);
uint32_t value_summ_digits(uint32_t value);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_01.cpp
* @return uint32_t Quantity of digits
*/
uint32_t value_digits_quantity(uint32_t value) {
uint32_t quantity = 1;

Copy link
Copy Markdown
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};

Comment thread HW_02_01.cpp
uint32_t value_summ_digits(uint32_t value) {
uint32_t summ = 0;

for (; value; value /= 10) {

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

Comment thread HW_02_01.cpp
@@ -0,0 +1,59 @@
#include <cstdint>
#include <cstdlib>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_02.cpp
@@ -0,0 +1,125 @@
#include <bits/c++config.h>
#include <bits/stdint-uintn.h>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_05.cpp
auto devider{value};

while (value % --devider) {
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_06.cpp
@@ -0,0 +1,64 @@
#include <bits/stdint-uintn.h>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_06.cpp
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <ostream>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_06.cpp
* @return true
* @return false
*/
inline bool is_even(int value) { return (value % 2 == 0); } No newline at end of file

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

Comment thread HW_02_07.cpp
std::cout << "-->";
std::cin >> value;

if (!value_dec_2_bin(value, BIT_MASK, BIT_MASK_SIZE)) {

Copy link
Copy Markdown
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