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

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.

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


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}));
} No newline at end of file
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