Skip to content

Conversation

@kamendov-maxim
Copy link
Owner

No description provided.

Choose a reason for hiding this comment

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

В PR не должно быть изменений в файлах, не связанных с задачей.


#define SIZE sizeof(int) * 8

int decimalToBinary(int number, int answer[]);

Choose a reason for hiding this comment

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

лучше хранить биты в char

Choose a reason for hiding this comment

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

Принято передавать массив в функцию по указателю

if (!test())
{
printf("Похоже, что сейчас программа не работает корректно");
return 1;

Choose a reason for hiding this comment

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

коды ошибок и возврата выносим в define

Comment on lines +49 to +53
int exp = 2;
for (int i = 0; i < SIZE; ++i)
{
exp = exp * 2;
}

Choose a reason for hiding this comment

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

exp не используется

int elementsScanned1 = scanf("%d", &number1);
if (elementsScanned1 != 1)
{
printf("Похоже, что-то пошло не так\n");

Choose a reason for hiding this comment

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

"Похоже, что-то пошло не так\n" нужно вынести в константу

Comment on lines +261 to +266
if (!(test1 == binaryToDecimal(binary1)) * (test2 == binaryToDecimal(binary2)) * (test3 == binaryToDecimal(binary3)) * (test4 == binaryToDecimal(binary4)))
{
return false;
}

return true;

Choose a reason for hiding this comment

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

убрать if, нормально написать конъюнкцию через &&

Comment on lines +286 to +291
if (!(test1 * test2 * test3))
{
return false;
}

return true;

Choose a reason for hiding this comment

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

убрать if, нормально написать конъюнкцию через &&

return true;
}

bool testStarterAddition(int a, int b, int answer)

Choose a reason for hiding this comment

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

testCaseAddition

Comment on lines +320 to +325
if (decimalAnswer != answer)
{
return false;
}

return true;

Choose a reason for hiding this comment

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

убрать if

}

return true;
} No newline at end of file

Choose a reason for hiding this comment

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

Перенос строки в конце файла

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.

3 participants