Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done homework_1 #18

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

MrWh1teF0x
Copy link

No description provided.

int main() { return 0; }
#include "topology_sort.hpp"

long long GetSize() {
Copy link
Contributor

Choose a reason for hiding this comment

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

лучше смотрится size_t для размеров массива

}

int main() {
long long n = GetNumber();
Copy link
Contributor

Choose a reason for hiding this comment

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

давай не будем называть переменные одной буквой

task_01/src/test.cpp Show resolved Hide resolved

std::pair<long long, long long> GetTwoNums(long long n,
std::vector<long long> nums) {
size_t l = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

однобуквенные переменные(

std::pair<long long, long long> GetTwoNums(long long number,
std::vector<long long> nums) {
if (nums.size() <= 1) {
return {-1, -1};
Copy link
Contributor

Choose a reason for hiding this comment

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

кажется лучше тогда кинуть исключение

Copy link
Contributor

Choose a reason for hiding this comment

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

переименуй файл

TEST(GetTwoNums, Test_10) {
ASSERT_EQ(GetTwoNums(100, std::vector<long long>{}),
(std::pair<long long, long long>{-1, -1}));
}
Copy link
Contributor

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.

2 participants