Skip to content

Коммит ДЗ#6

Open
SL-TX wants to merge 2 commits intomasterfrom
homework5
Open

Коммит ДЗ#6
SL-TX wants to merge 2 commits intomasterfrom
homework5

Conversation

@SL-TX
Copy link
Copy Markdown
Owner

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

1.5 Массивы

public static void main(String[] args) {

// Задание 1
int[] i = new int[3];
Copy link
Copy Markdown

@iStemmer iStemmer Aug 20, 2022

Choose a reason for hiding this comment

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

i - очень плохое имя для массива, i,j,k,m,n,l - используются для циклов - легко можно запутаться
Надо поправить

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Переименновать все переменные в intArray, doubleArray, charArray или для ДЗ так оставить?

// Задание 4
for (int j = 0; j < i.length; j++) {
if (i[j]%2==1)
i[j]+=1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

не забываем про форматирование Ctrl+Alt+L


// Задание 2
for (int j = 0; j < i.length; j++) {
if (j == i.length - 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

используй {} в циклах, даже если это не обязательно, гугл рекомендует придерживаться

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

В циклах или в If -ах?

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