-
Notifications
You must be signed in to change notification settings - Fork 40
Кутузова Анна Александровна Фт-320010 #43
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #include "two-sum.hpp" | ||
|
|
||
| bool two_sum( | ||
| const int nums[ARRAY_SIZE], | ||
| const int target, | ||
| std::size_t& index0, | ||
| std::size_t& index1 | ||
| ) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. С самим кодом все хорошо, но надо соблюдать последовательность в стиле) Между сигнатурой функции и телом обычно не ставят новую строку, пробелы в Для домашнего задания в университете совсем не критично, но в реальных проектах обычно за этим следят |
||
|
|
||
| { | ||
| for(int i = 0; i < ARRAY_SIZE - 1;i++) | ||
| { | ||
| for(int j = i+1; j < ARRAY_SIZE; j++) | ||
| { | ||
| if(nums[i] + nums[j] == target) | ||
| { | ||
| index0 = i; | ||
| index1 = j; | ||
| return true; | ||
| } | ||
| } | ||
| } | ||
| return false; | ||
| }; | ||
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.
Файл назван
srctwo-sum.cpp, а неtwo-sum.cpp. И находится в корневой директории проекта, а не вsrc/. Из-за этого не собираются тестыКак поправить: