-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: main
Are you sure you want to change the base?
Done homework_1 #18
Conversation
task_01/src/main.cpp
Outdated
int main() { return 0; } | ||
#include "topology_sort.hpp" | ||
|
||
long long GetSize() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше смотрится size_t для размеров массива
task_01/src/main.cpp
Outdated
} | ||
|
||
int main() { | ||
long long n = GetNumber(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
давай не будем называть переменные одной буквой
task_01/src/topology_sort.cpp
Outdated
|
||
std::pair<long long, long long> GetTwoNums(long long n, | ||
std::vector<long long> nums) { | ||
size_t l = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
однобуквенные переменные(
task_01/src/topology_sort.cpp
Outdated
std::pair<long long, long long> GetTwoNums(long long number, | ||
std::vector<long long> nums) { | ||
if (nums.size() <= 1) { | ||
return {-1, -1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
кажется лучше тогда кинуть исключение
task_01/src/topology_sort.cpp
Outdated
There was a problem hiding this comment.
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
Outdated
TEST(GetTwoNums, Test_10) { | ||
ASSERT_EQ(GetTwoNums(100, std::vector<long long>{}), | ||
(std::pair<long long, long long>{-1, -1})); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не хватает теста если в массиве нет чисел дающие в сумме нужное число
No description provided.