Skip to content

Done homework_1#18

Open
MrWh1teF0x wants to merge 15 commits intoAlgorithmsDafeMipt2024:mainfrom
MrWh1teF0x:main
Open

Done homework_1#18
MrWh1teF0x wants to merge 15 commits intoAlgorithmsDafeMipt2024:mainfrom
MrWh1teF0x:main

Conversation

@MrWh1teF0x
Copy link
Copy Markdown

No description provided.

Comment thread task_01/src/main.cpp Outdated
int main() { return 0; }
#include "topology_sort.hpp"

long long GetSize() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread task_01/src/main.cpp Outdated
}

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

Choose a reason for hiding this comment

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

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

Comment thread task_01/src/test.cpp
Comment thread 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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

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

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread 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}));
} No newline at end of file
Copy link
Copy Markdown
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