Skip to content

Коммит ДЗ#7

Open
SL-TX wants to merge 1 commit intomasterfrom
homework6
Open

Коммит ДЗ#7
SL-TX wants to merge 1 commit intomasterfrom
homework6

Conversation

@SL-TX
Copy link
Copy Markdown
Owner

@SL-TX SL-TX commented Aug 20, 2022

1.6. Массивы ч.2


// Задание 1
int sum=0;
for (int i : arr) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

здесь лучше назвать переменную более осознанно, т.к. обычно i называют индексы массива, а здесь уже не индекс, а элемент

// Задание 2
int min = 0,max=0;
for (int i : arr) {
if (min ==0 || min > i)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

фигурные скобки надо ставить

for (int i : arr) {
if (min ==0 || min > i)
min = i;
if (max ==0 || max < i)
Copy link
Copy Markdown

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