-
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
Homework 1 #9
base: main
Are you sure you want to change the base?
Homework 1 #9
Conversation
task_01/src/utils.cpp
Outdated
#include <vector> | ||
|
||
std::pair<int, int> Func(int number, const std::vector<int> array) { | ||
int left_ind = 0, right_ind = array.size() - 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.
давай уже не экономить символы (left_index) и строки (1 объявление 1 строка)
task_01/src/main.cpp
Outdated
int main() { return 0; } | ||
#include <bits/stdc++.h> | ||
#include "utils.hpp" | ||
using namespace std; |
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.
отделяй пустыми строками блоки кода, да и я не очень одобряю using namespace на весь файл
форматеры упали |
task_01/src/utils.cpp
Outdated
right_index--; | ||
} | ||
} | ||
if (array[left_index] + array[right_index] != number) { |
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.
я бы убрал этот if, что-то поменяется и он не всегда работать будет, тогда функция вернет непонятно что если в этот if не зайдет
No description provided.