Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Элина Мажитова
mesh_loader
Commits
ddfee2ca
Commit
ddfee2ca
authored
3 years ago
by
Илья Богданов
Browse files
Options
Download
Patches
Plain Diff
Замечания по main.cpp
parent
42e52a37
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LW1.2/main.cpp
+5
-3
LW1.2/main.cpp
with
5 additions
and
3 deletions
+5
-3
LW1.2/main.cpp
+
5
−
3
View file @
ddfee2ca
...
...
@@ -50,12 +50,14 @@ void Protection_task(MeshLoader& MyKE)
std
::
cin
>>
id
;
std
::
set
<
int
>
Container
=
MyKE
.
Get_Elements_by_ID_area
(
id
);
//!!! Для поиска минимального элемента есть ranges::min_element, принимающий бинарный предикат,->ИСПРАВЛЕНО
//!!! в данном случае для сревнения площадей->ИСПРАВЛЕНО
std
::
vector
<
double
>
SquareElements
;
std
::
ranges
::
for_each
(
Container
,
[
&
](
auto
&
elem
)
{
SquareElements
.
push_back
(
square
(
MyKE
,
elem
));
});
auto
IterResult
=
std
::
ranges
::
min_element
(
SquareElements
);
///!!! Для поиска есть min_element. Что мешает сделать бинарный предикат, который сравнивает объекты самих элементов
///!!! и зачем делать отдельный контейнер???
std
::
cout
<<
*
(
std
::
next
(
Container
.
begin
(),
std
::
ranges
::
distance
(
SquareElements
.
begin
(),
IterResult
)));
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets